chamelaion 0.2.0 → 0.4.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.
- package/CHANGELOG.md +22 -0
- package/README.md +3 -3
- package/api-promise.js.map +1 -1
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +17 -65
- package/client.js.map +1 -1
- package/client.mjs +19 -67
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js +2 -2
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/error.js.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +5 -5
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts +5 -5
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/detect-platform.d.mts.map +1 -1
- package/internal/detect-platform.d.ts.map +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.js +5 -6
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs +5 -6
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.js +2 -2
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +2 -2
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +1 -7
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +1 -7
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/shim-types.d.mts.map +1 -1
- package/internal/shim-types.d.ts.map +1 -1
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts.map +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +11 -17
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +11 -17
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -9
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -9
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +4 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +4 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/package.json +2 -2
- package/resource.js.map +1 -1
- package/resources/health.d.mts.map +1 -1
- package/resources/health.d.ts.map +1 -1
- package/resources/health.js.map +1 -1
- package/resources/health.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -0
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -1
- package/resources/index.mjs.map +1 -1
- package/resources/lipsync/index.d.mts +1 -1
- package/resources/lipsync/index.d.mts.map +1 -1
- package/resources/lipsync/index.d.ts +1 -1
- package/resources/lipsync/index.d.ts.map +1 -1
- package/resources/lipsync/index.js +2 -0
- package/resources/lipsync/index.js.map +1 -1
- package/resources/lipsync/index.mjs +3 -1
- package/resources/lipsync/index.mjs.map +1 -1
- package/resources/lipsync/lipsync.d.mts +2 -2
- package/resources/lipsync/lipsync.d.mts.map +1 -1
- package/resources/lipsync/lipsync.d.ts +2 -2
- package/resources/lipsync/lipsync.d.ts.map +1 -1
- package/resources/lipsync/lipsync.js.map +1 -1
- package/resources/lipsync/lipsync.mjs.map +1 -1
- package/resources/lipsync/requests.d.mts +1 -1
- package/resources/lipsync/requests.d.mts.map +1 -1
- package/resources/lipsync/requests.d.ts +1 -1
- package/resources/lipsync/requests.d.ts.map +1 -1
- package/resources/lipsync/requests.js.map +1 -1
- package/resources/lipsync/requests.mjs.map +1 -1
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts.map +1 -1
- package/src/api-promise.ts +1 -1
- package/src/client.ts +64 -153
- package/src/core/api-promise.ts +2 -7
- package/src/core/error.ts +24 -22
- package/src/error.ts +1 -1
- package/src/index.ts +1 -15
- package/src/internal/builtin-types.ts +9 -14
- package/src/internal/detect-platform.ts +1 -5
- package/src/internal/errors.ts +7 -7
- package/src/internal/headers.ts +2 -2
- package/src/internal/parse.ts +2 -10
- package/src/internal/request-options.ts +6 -2
- package/src/internal/shim-types.ts +2 -2
- package/src/internal/shims.ts +1 -3
- package/src/internal/to-file.ts +7 -7
- package/src/internal/types.ts +22 -28
- package/src/internal/utils/log.ts +8 -30
- package/src/internal/utils/uuid.ts +5 -3
- package/src/resource.ts +1 -1
- package/src/resources/health.ts +4 -2
- package/src/resources/index.ts +3 -8
- package/src/resources/lipsync/index.ts +2 -7
- package/src/resources/lipsync/lipsync.ts +4 -10
- package/src/resources/lipsync/requests.ts +2 -5
- package/src/resources/users.ts +3 -1
- package/src/uploads.ts +1 -1
- package/src/version.ts +1 -1
- package/uploads.js.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -75,13 +75,17 @@ export type RequestOptions = {
|
|
|
75
75
|
*/
|
|
76
76
|
defaultBaseURL?: string | undefined;
|
|
77
77
|
|
|
78
|
-
__security?: { bearerAuth?: boolean
|
|
78
|
+
__security?: { bearerAuth?: boolean, apiKeyAuth?: boolean };
|
|
79
79
|
|
|
80
80
|
__binaryResponse?: boolean | undefined;
|
|
81
|
+
|
|
81
82
|
};
|
|
82
83
|
|
|
83
84
|
export type EncodedContent = { bodyHeaders: HeadersLike; body: BodyInit };
|
|
84
|
-
export type RequestEncoder = (request: {
|
|
85
|
+
export type RequestEncoder = (request: {
|
|
86
|
+
headers: NullableHeaders;
|
|
87
|
+
body: unknown;
|
|
88
|
+
}) => EncodedContent;
|
|
85
89
|
|
|
86
90
|
export const FallbackEncoder: RequestEncoder = ({ headers, body }) => {
|
|
87
91
|
return {
|
|
@@ -19,8 +19,8 @@ type _ConditionalNodeReadableStream<R = any> =
|
|
|
19
19
|
typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream<R>;
|
|
20
20
|
|
|
21
21
|
type _ReadableStream<R = any> = NeverToAny<
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>) |
|
|
23
|
+
([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)
|
|
24
24
|
>;
|
|
25
25
|
|
|
26
26
|
export type { _ReadableStream as ReadableStream };
|
package/src/internal/shims.ts
CHANGED
|
@@ -27,9 +27,7 @@ export function makeReadableStream(...args: ReadableStreamArgs): ReadableStream
|
|
|
27
27
|
if (typeof ReadableStream === 'undefined') {
|
|
28
28
|
// Note: All of the platforms / runtimes we officially support already define
|
|
29
29
|
// `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
|
|
30
|
-
throw new Error(
|
|
31
|
-
'`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`',
|
|
32
|
-
);
|
|
30
|
+
throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
return new ReadableStream(...args);
|
package/src/internal/to-file.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlobPart, getName, makeFile, isAsyncIterable } from
|
|
1
|
+
import { BlobPart, getName, makeFile, isAsyncIterable } from "./uploads";
|
|
2
2
|
import type { FilePropertyBag } from './builtin-types';
|
|
3
3
|
import { checkFileSupport } from './uploads';
|
|
4
4
|
|
|
@@ -65,11 +65,8 @@ const isResponseLike = (value: any): value is ResponseLike =>
|
|
|
65
65
|
typeof value.url === 'string' &&
|
|
66
66
|
typeof value.blob === 'function';
|
|
67
67
|
|
|
68
|
-
export type ToFileInput =
|
|
69
|
-
|
|
70
|
-
| ResponseLike
|
|
71
|
-
| Exclude<BlobLikePart, string>
|
|
72
|
-
| AsyncIterable<BlobLikePart>;
|
|
68
|
+
export type ToFileInput = FileLike | ResponseLike | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
69
|
+
|
|
73
70
|
|
|
74
71
|
/**
|
|
75
72
|
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
@@ -119,7 +116,9 @@ export async function toFile(
|
|
|
119
116
|
return makeFile(parts, name, options);
|
|
120
117
|
}
|
|
121
118
|
|
|
122
|
-
async function getBytes(
|
|
119
|
+
async function getBytes(
|
|
120
|
+
value: BlobLikePart | AsyncIterable<BlobLikePart>,
|
|
121
|
+
): Promise<Array<BlobPart>> {
|
|
123
122
|
let parts: Array<BlobPart> = [];
|
|
124
123
|
if (
|
|
125
124
|
typeof value === 'string' ||
|
|
@@ -152,3 +151,4 @@ function propsForError(value: unknown): string {
|
|
|
152
151
|
const props = Object.getOwnPropertyNames(value);
|
|
153
152
|
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
154
153
|
}
|
|
154
|
+
|
package/src/internal/types.ts
CHANGED
|
@@ -7,40 +7,34 @@ export type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
|
|
7
7
|
|
|
8
8
|
export type FinalizedRequestInit = RequestInit & { headers: Headers };
|
|
9
9
|
|
|
10
|
-
type NotAny<T> = [0] extends [1 & T] ? never : T;
|
|
10
|
+
type NotAny<T> = [0] extends [(1 & T)] ? never : T;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
|
|
14
14
|
*/
|
|
15
|
-
type OverloadedParameters<T> =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
type OverloadedParameters<T> = T extends {
|
|
16
|
+
(...args: infer A): unknown;
|
|
17
|
+
(...args: infer B): unknown;
|
|
18
|
+
(...args: infer C): unknown;
|
|
19
|
+
(...args: infer D): unknown;
|
|
20
|
+
}
|
|
21
|
+
? A | B | C | D
|
|
22
|
+
: T extends {
|
|
18
23
|
(...args: infer A): unknown;
|
|
19
24
|
(...args: infer B): unknown;
|
|
20
25
|
(...args: infer C): unknown;
|
|
21
|
-
(...args: infer D): unknown;
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
: T extends (
|
|
26
|
-
{
|
|
27
|
-
(...args: infer A): unknown;
|
|
28
|
-
(...args: infer B): unknown;
|
|
29
|
-
(...args: infer C): unknown;
|
|
30
|
-
}
|
|
31
|
-
) ?
|
|
32
|
-
A | B | C
|
|
33
|
-
: T extends (
|
|
34
|
-
{
|
|
27
|
+
? A | B | C
|
|
28
|
+
: T extends {
|
|
35
29
|
(...args: infer A): unknown;
|
|
36
30
|
(...args: infer B): unknown;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
? A | B
|
|
33
|
+
: T extends (...args: infer A) => unknown
|
|
34
|
+
? A
|
|
41
35
|
: never;
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
|
|
44
38
|
/**
|
|
45
39
|
* These imports attempt to get types from a parent package's dependencies.
|
|
46
40
|
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
@@ -63,19 +57,19 @@ type OverloadedParameters<T> =
|
|
|
63
57
|
*
|
|
64
58
|
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
65
59
|
*/
|
|
66
|
-
/** @ts-ignore For users with \@types/node */
|
|
60
|
+
/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
|
|
67
61
|
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
|
|
68
|
-
/** @ts-ignore For users with undici */
|
|
62
|
+
/** @ts-ignore For users with undici */ /* prettier-ignore */
|
|
69
63
|
type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
|
|
70
|
-
/** @ts-ignore For users with \@types/bun */
|
|
64
|
+
/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
|
|
71
65
|
type BunRequestInit = globalThis.FetchRequestInit;
|
|
72
|
-
/** @ts-ignore For users with node-fetch@2 */
|
|
66
|
+
/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
|
|
73
67
|
type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
|
|
74
|
-
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
|
|
68
|
+
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
|
|
75
69
|
type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
76
|
-
/** @ts-ignore For users who use Deno */
|
|
70
|
+
/** @ts-ignore For users who use Deno */ /* prettier-ignore */
|
|
77
71
|
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
78
|
-
|
|
72
|
+
|
|
79
73
|
|
|
80
74
|
type RequestInits =
|
|
81
75
|
| NotAny<UndiciTypesRequestInit>
|
|
@@ -4,7 +4,7 @@ import { hasOwn } from './values';
|
|
|
4
4
|
import { type Chamelaion } from '../../client';
|
|
5
5
|
import { RequestOptions } from '../request-options';
|
|
6
6
|
|
|
7
|
-
type LogFn = (message: string, ...rest: unknown[]) => void
|
|
7
|
+
type LogFn = (message: string, ...rest: unknown[]) => void
|
|
8
8
|
export type Logger = {
|
|
9
9
|
error: LogFn;
|
|
10
10
|
warn: LogFn;
|
|
@@ -21,22 +21,14 @@ const levelNumbers = {
|
|
|
21
21
|
debug: 500,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const parseLogLevel = (
|
|
25
|
-
maybeLevel: string | undefined,
|
|
26
|
-
sourceName: string,
|
|
27
|
-
client: Chamelaion,
|
|
28
|
-
): LogLevel | undefined => {
|
|
24
|
+
export const parseLogLevel = (maybeLevel: string | undefined, sourceName: string, client: Chamelaion): LogLevel | undefined => {
|
|
29
25
|
if (!maybeLevel) {
|
|
30
26
|
return undefined;
|
|
31
27
|
}
|
|
32
28
|
if (hasOwn(levelNumbers, maybeLevel)) {
|
|
33
29
|
return maybeLevel;
|
|
34
|
-
}
|
|
35
|
-
loggerFor(client).warn(
|
|
36
|
-
`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(
|
|
37
|
-
Object.keys(levelNumbers),
|
|
38
|
-
)}`,
|
|
39
|
-
);
|
|
30
|
+
};
|
|
31
|
+
loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);
|
|
40
32
|
return undefined;
|
|
41
33
|
};
|
|
42
34
|
|
|
@@ -97,25 +89,11 @@ export const formatRequestDetails = (details: {
|
|
|
97
89
|
body?: unknown;
|
|
98
90
|
}) => {
|
|
99
91
|
if (details.options) {
|
|
100
|
-
details.options = {
|
|
92
|
+
details.options = {...details.options};
|
|
101
93
|
delete details.options['headers']; // redundant + leaks internals
|
|
102
94
|
}
|
|
103
95
|
if (details.headers) {
|
|
104
|
-
details.headers = Object.fromEntries(
|
|
105
|
-
(details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
|
|
106
|
-
([name, value]) => [
|
|
107
|
-
name,
|
|
108
|
-
(
|
|
109
|
-
name.toLowerCase() === 'authorization' ||
|
|
110
|
-
name.toLowerCase() === 'x-api-key' ||
|
|
111
|
-
name.toLowerCase() === 'cookie' ||
|
|
112
|
-
name.toLowerCase() === 'set-cookie'
|
|
113
|
-
) ?
|
|
114
|
-
'***'
|
|
115
|
-
: value,
|
|
116
|
-
],
|
|
117
|
-
),
|
|
118
|
-
);
|
|
96
|
+
details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [name, name.toLowerCase() === 'authorization' || name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'cookie' || name.toLowerCase() === 'set-cookie' ? '***' : value]))
|
|
119
97
|
}
|
|
120
98
|
if ('retryOfRequestLogID' in details) {
|
|
121
99
|
if (details.retryOfRequestLogID) {
|
|
@@ -123,5 +101,5 @@ export const formatRequestDetails = (details: {
|
|
|
123
101
|
}
|
|
124
102
|
delete details.retryOfRequestLogID;
|
|
125
103
|
}
|
|
126
|
-
return details
|
|
127
|
-
}
|
|
104
|
+
return details
|
|
105
|
+
}
|
|
@@ -10,8 +10,10 @@ export let uuid4 = function () {
|
|
|
10
10
|
return crypto.randomUUID();
|
|
11
11
|
}
|
|
12
12
|
const u8 = new Uint8Array(1);
|
|
13
|
-
const randomByte = crypto
|
|
14
|
-
|
|
13
|
+
const randomByte = crypto
|
|
14
|
+
? () => crypto.getRandomValues(u8)[0]!
|
|
15
|
+
: () => (Math.random() * 0xff) & 0xff;
|
|
16
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) =>
|
|
15
17
|
(+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
|
|
16
18
|
);
|
|
17
|
-
}
|
|
19
|
+
}
|
package/src/resource.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @deprecated Import from ./core/resource instead */
|
|
2
|
-
export * from
|
|
2
|
+
export * from "./core/resource"
|
package/src/resources/health.ts
CHANGED
|
@@ -12,7 +12,7 @@ export class Health extends APIResource {
|
|
|
12
12
|
* Returns HTTP 200 when the service is running. No authentication required.
|
|
13
13
|
*/
|
|
14
14
|
check(options?: RequestOptions): APIPromise<HealthCheckResponse> {
|
|
15
|
-
return this._client.get('/health', { ...options, __security: {} });
|
|
15
|
+
return this._client.get('/health', { ...options, __security: { } });
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -21,5 +21,7 @@ export interface HealthCheckResponse {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export declare namespace Health {
|
|
24
|
-
export {
|
|
24
|
+
export {
|
|
25
|
+
type HealthCheckResponse as HealthCheckResponse
|
|
26
|
+
};
|
|
25
27
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export { Health, type HealthCheckResponse } from './health'
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
type LipsyncGenerate,
|
|
7
|
-
type LipsyncGenerateParams,
|
|
8
|
-
type LipsyncGenerateWithMediaParams,
|
|
9
|
-
} from './lipsync/lipsync';
|
|
10
|
-
export { Users, type UserRetrieveCurrentResponse } from './users';
|
|
3
|
+
export { Health, type HealthCheckResponse } from './health';;
|
|
4
|
+
export { Lipsync, type LipsyncGenerate, type LipsyncGenerateParams, type LipsyncGenerateWithMediaParams } from './lipsync/lipsync';;
|
|
5
|
+
export { Users, type UserRetrieveCurrentResponse } from './users';;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
type LipsyncGenerate,
|
|
6
|
-
type LipsyncGenerateParams,
|
|
7
|
-
type LipsyncGenerateWithMediaParams,
|
|
8
|
-
} from './lipsync';
|
|
9
|
-
export { Requests, type LipsyncRequest, type RequestListResponse, type RequestListParams } from './requests';
|
|
3
|
+
export { Lipsync, type LipsyncGenerate, type LipsyncGenerateParams, type LipsyncGenerateWithMediaParams } from './lipsync';;
|
|
4
|
+
export { Requests, type LipsyncRequest, type RequestListResponse, type RequestListParams } from './requests';;
|
|
@@ -54,14 +54,8 @@ export class Lipsync extends APIResource {
|
|
|
54
54
|
* });
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
generateWithMedia(
|
|
58
|
-
body
|
|
59
|
-
options?: RequestOptions,
|
|
60
|
-
): APIPromise<LipsyncGenerate> {
|
|
61
|
-
return this._client.post(
|
|
62
|
-
'/v1/lipsync/generate-with-media',
|
|
63
|
-
multipartFormRequestOptions({ body, ...options }, this._client),
|
|
64
|
-
);
|
|
57
|
+
generateWithMedia(body: LipsyncGenerateWithMediaParams, options?: RequestOptions): APIPromise<LipsyncGenerate> {
|
|
58
|
+
return this._client.post('/v1/lipsync/generate-with-media', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
61
|
|
|
@@ -141,13 +135,13 @@ export declare namespace Lipsync {
|
|
|
141
135
|
export {
|
|
142
136
|
type LipsyncGenerate as LipsyncGenerate,
|
|
143
137
|
type LipsyncGenerateParams as LipsyncGenerateParams,
|
|
144
|
-
type LipsyncGenerateWithMediaParams as LipsyncGenerateWithMediaParams
|
|
138
|
+
type LipsyncGenerateWithMediaParams as LipsyncGenerateWithMediaParams
|
|
145
139
|
};
|
|
146
140
|
|
|
147
141
|
export {
|
|
148
142
|
Requests as Requests,
|
|
149
143
|
type LipsyncRequest as LipsyncRequest,
|
|
150
144
|
type RequestListResponse as RequestListResponse,
|
|
151
|
-
type RequestListParams as RequestListParams
|
|
145
|
+
type RequestListParams as RequestListParams
|
|
152
146
|
};
|
|
153
147
|
}
|
|
@@ -32,10 +32,7 @@ export class Requests extends APIResource {
|
|
|
32
32
|
* const requests = await client.lipsync.requests.list();
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
list(
|
|
36
|
-
query: RequestListParams | null | undefined = {},
|
|
37
|
-
options?: RequestOptions,
|
|
38
|
-
): APIPromise<RequestListResponse> {
|
|
35
|
+
list(query: RequestListParams | null | undefined = {}, options?: RequestOptions): APIPromise<RequestListResponse> {
|
|
39
36
|
return this._client.get('/v1/lipsync/requests', { query, ...options });
|
|
40
37
|
}
|
|
41
38
|
}
|
|
@@ -128,6 +125,6 @@ export declare namespace Requests {
|
|
|
128
125
|
export {
|
|
129
126
|
type LipsyncRequest as LipsyncRequest,
|
|
130
127
|
type RequestListResponse as RequestListResponse,
|
|
131
|
-
type RequestListParams as RequestListParams
|
|
128
|
+
type RequestListParams as RequestListParams
|
|
132
129
|
};
|
|
133
130
|
}
|
package/src/resources/users.ts
CHANGED
package/src/uploads.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @deprecated Import from ./core/uploads instead */
|
|
2
|
-
export * from
|
|
2
|
+
export * from "./core/uploads"
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0';// x-release-please-version
|
package/uploads.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4DAA8B"}
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAA,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAA,2BAA2B"}
|