mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 12:37:46 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c04752d88 |
@@ -1,5 +1,4 @@
|
|||||||
/*
|
**/*
|
||||||
/docs/**/*.md
|
|
||||||
!/**/*.ts
|
!/**/*.ts
|
||||||
!/**/*.js
|
!/**/*.js
|
||||||
!/**/*.map
|
!/**/*.map
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ id: 16f22cbf-f23f-4419-8924-3a4b06381947
|
|||||||
management:
|
management:
|
||||||
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
|
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: 1.257.1
|
speakeasyVersion: 1.260.6
|
||||||
generationVersion: 2.308.2
|
generationVersion: 2.311.1
|
||||||
releaseVersion: 0.12.3
|
releaseVersion: 0.13.0
|
||||||
configChecksum: 752ce7e0cf6b7bbb5052a974f083e656
|
configChecksum: 62265d55fc035cecbf6f03081c6e5587
|
||||||
repoURL: https://github.com/LukeHagar/plexjs.git
|
repoURL: https://github.com/LukeHagar/plexjs.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
installationURL: https://github.com/LukeHagar/plexjs
|
installationURL: https://github.com/LukeHagar/plexjs
|
||||||
@@ -14,7 +14,7 @@ management:
|
|||||||
features:
|
features:
|
||||||
typescript:
|
typescript:
|
||||||
constsAndDefaults: 0.1.5
|
constsAndDefaults: 0.1.5
|
||||||
core: 3.7.2
|
core: 3.8.0
|
||||||
flattening: 2.81.1
|
flattening: 2.81.1
|
||||||
globalSecurity: 2.82.9
|
globalSecurity: 2.82.9
|
||||||
globalServerURLs: 2.82.4
|
globalServerURLs: 2.82.4
|
||||||
@@ -42,6 +42,7 @@ generatedFiles:
|
|||||||
- .eslintrc.js
|
- .eslintrc.js
|
||||||
- .npmignore
|
- .npmignore
|
||||||
- RUNTIMES.md
|
- RUNTIMES.md
|
||||||
|
- jsr.json
|
||||||
- package.json
|
- package.json
|
||||||
- src/index.ts
|
- src/index.ts
|
||||||
- src/lib/base64.ts
|
- src/lib/base64.ts
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.257.1
|
speakeasyVersion: 1.260.6
|
||||||
sources:
|
sources:
|
||||||
my-source: {}
|
my-source: {}
|
||||||
targets:
|
targets:
|
||||||
|
|||||||
10
RELEASES.md
10
RELEASES.md
@@ -319,3 +319,13 @@ Based on:
|
|||||||
- [typescript v0.12.3] .
|
- [typescript v0.12.3] .
|
||||||
### Releases
|
### Releases
|
||||||
- [NPM v0.12.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.12.3 - .
|
- [NPM v0.12.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.12.3 - .
|
||||||
|
|
||||||
|
## 2024-04-19 00:26:47
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.260.6 (2.311.1) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.13.0] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.13.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.13.0 - .
|
||||||
2
gen.yaml
2
gen.yaml
@@ -12,7 +12,7 @@ generation:
|
|||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: false
|
oAuth2ClientCredentialsEnabled: false
|
||||||
typescript:
|
typescript:
|
||||||
version: 0.12.3
|
version: 0.13.0
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dependencies: {}
|
dependencies: {}
|
||||||
devDependencies: {}
|
devDependencies: {}
|
||||||
|
|||||||
26
jsr.json
Normal file
26
jsr.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "@lukehagar/plexjs",
|
||||||
|
"version": "0.13.0",
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index.ts",
|
||||||
|
"./models/errors": "./src/models/errors/index.ts",
|
||||||
|
"./models/components": "./src/models/components/index.ts",
|
||||||
|
"./models/operations": "./src/models/operations/index.ts",
|
||||||
|
"./lib/config": "./src/lib/config.ts",
|
||||||
|
"./lib/http": "./src/lib/http.ts",
|
||||||
|
"./lib/retries": "./src/lib/retries.ts",
|
||||||
|
"./lib/sdks": "./src/lib/sdks.ts",
|
||||||
|
"./types": "./src/types/index.ts"
|
||||||
|
},
|
||||||
|
"publish": {
|
||||||
|
"include": [
|
||||||
|
"LICENSE",
|
||||||
|
"README.md",
|
||||||
|
"RUNTIMES.md",
|
||||||
|
"USAGE.md",
|
||||||
|
"src/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.12.3",
|
"version": "0.13.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.12.3",
|
"version": "0.13.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jsonpath": "^0.2.4",
|
"@types/jsonpath": "^0.2.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.12.3",
|
"version": "0.13.0",
|
||||||
"author": "LukeHagar",
|
"author": "LukeHagar",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import { HTTPClient } from "./http";
|
import { HTTPClient } from "./http";
|
||||||
import { RetryConfig } from "./retries";
|
import { RetryConfig } from "./retries";
|
||||||
import { pathToFunc } from "./url";
|
import { Params, pathToFunc } from "./url";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the list of servers available to the SDK
|
* Contains the list of servers available to the SDK
|
||||||
@@ -62,14 +62,14 @@ export type SDKOptions = {
|
|||||||
export function serverURLFromOptions(options: SDKOptions): URL | null {
|
export function serverURLFromOptions(options: SDKOptions): URL | null {
|
||||||
let serverURL = options.serverURL;
|
let serverURL = options.serverURL;
|
||||||
|
|
||||||
const serverParams = [
|
const serverParams: Params[] = [
|
||||||
{
|
{
|
||||||
protocol: options.protocol?.toString() ?? "http",
|
protocol: options.protocol ?? "http",
|
||||||
ip: options.ip?.toString() ?? "10.10.10.47",
|
ip: options.ip ?? "10.10.10.47",
|
||||||
port: options.port?.toString() ?? "32400",
|
port: options.port ?? "32400",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
let params: Record<string, string> = {};
|
let params: Params = {};
|
||||||
|
|
||||||
if (!serverURL) {
|
if (!serverURL) {
|
||||||
const serverIdx = options.serverIdx ?? 0;
|
const serverIdx = options.serverIdx ?? 0;
|
||||||
@@ -84,10 +84,10 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|||||||
return new URL(u);
|
return new URL(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SDK_METADATA = Object.freeze({
|
export const SDK_METADATA = {
|
||||||
language: "typescript",
|
language: "typescript",
|
||||||
openapiDocVersion: "0.0.3",
|
openapiDocVersion: "0.0.3",
|
||||||
sdkVersion: "0.12.3",
|
sdkVersion: "0.13.0",
|
||||||
genVersion: "2.308.2",
|
genVersion: "2.311.1",
|
||||||
userAgent: "speakeasy-sdk/typescript 0.12.3 2.308.2 0.0.3 @lukehagar/plexjs",
|
userAgent: "speakeasy-sdk/typescript 0.13.0 2.311.1 0.0.3 @lukehagar/plexjs",
|
||||||
});
|
} as const;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function encodeMatrix(
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
) {
|
): string {
|
||||||
let out = "";
|
let out = "";
|
||||||
const pairs: [string, unknown][] = options?.explode
|
const pairs: [string, unknown][] = options?.explode
|
||||||
? explode(key, value)
|
? explode(key, value)
|
||||||
@@ -65,7 +65,7 @@ export function encodeLabel(
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
) {
|
): string {
|
||||||
let out = "";
|
let out = "";
|
||||||
const pairs: [string, unknown][] = options?.explode
|
const pairs: [string, unknown][] = options?.explode
|
||||||
? explode(key, value)
|
? explode(key, value)
|
||||||
@@ -100,7 +100,13 @@ export function encodeLabel(
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formEncoder(sep: string) {
|
type FormEncoder = (
|
||||||
|
key: string,
|
||||||
|
value: unknown,
|
||||||
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
|
) => string;
|
||||||
|
|
||||||
|
function formEncoder(sep: string): FormEncoder {
|
||||||
return (
|
return (
|
||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
@@ -157,7 +163,7 @@ export function encodeBodyForm(
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
) {
|
): string {
|
||||||
let out = "";
|
let out = "";
|
||||||
const pairs: [string, unknown][] = options?.explode
|
const pairs: [string, unknown][] = options?.explode
|
||||||
? explode(key, value)
|
? explode(key, value)
|
||||||
@@ -200,7 +206,7 @@ export function encodeDeepObject(
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { charEncoding?: "percent" | "none" },
|
options?: { charEncoding?: "percent" | "none" },
|
||||||
) {
|
): string {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -247,7 +253,7 @@ export function encodeJSON(
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
) {
|
): string {
|
||||||
if (typeof value === "undefined") {
|
if (typeof value === "undefined") {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -265,7 +271,7 @@ export const encodeSimple = (
|
|||||||
key: string,
|
key: string,
|
||||||
value: unknown,
|
value: unknown,
|
||||||
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
|
||||||
) => {
|
): string => {
|
||||||
let out = "";
|
let out = "";
|
||||||
const pairs: [string, unknown][] = options?.explode
|
const pairs: [string, unknown][] = options?.explode
|
||||||
? explode(key, value)
|
? explode(key, value)
|
||||||
@@ -337,7 +343,7 @@ function serializeValue(value: unknown): string {
|
|||||||
return `${value}`;
|
return `${value}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsonReplacer(_: string, value: unknown) {
|
function jsonReplacer(_: string, value: unknown): unknown {
|
||||||
if (value instanceof Uint8Array) {
|
if (value instanceof Uint8Array) {
|
||||||
return bytesToBase64(value);
|
return bytesToBase64(value);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export type Fetcher = (
|
|||||||
init?: RequestInit,
|
init?: RequestInit,
|
||||||
) => Promise<Response>;
|
) => Promise<Response>;
|
||||||
|
|
||||||
type Awaitable<T> = T | Promise<T>;
|
export type Awaitable<T> = T | Promise<T>;
|
||||||
|
|
||||||
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
|
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ export interface HTTPClientOptions {
|
|||||||
fetcher?: Fetcher;
|
fetcher?: Fetcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
type BeforeRequestHook = (req: Request) => Awaitable<Request | void>;
|
export type BeforeRequestHook = (req: Request) => Awaitable<Request | void>;
|
||||||
type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>;
|
export type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>;
|
||||||
type ResponseHook = (res: Response, req: Request) => Awaitable<void>;
|
export type ResponseHook = (res: Response, req: Request) => Awaitable<void>;
|
||||||
|
|
||||||
export class HTTPClient {
|
export class HTTPClient {
|
||||||
private fetcher: Fetcher;
|
private fetcher: Fetcher;
|
||||||
@@ -100,7 +100,7 @@ export class HTTPClient {
|
|||||||
| [hook: "beforeRequest", fn: BeforeRequestHook]
|
| [hook: "beforeRequest", fn: BeforeRequestHook]
|
||||||
| [hook: "requestError", fn: RequestErrorHook]
|
| [hook: "requestError", fn: RequestErrorHook]
|
||||||
| [hook: "response", fn: ResponseHook]
|
| [hook: "response", fn: ResponseHook]
|
||||||
) {
|
): this {
|
||||||
let target: unknown[];
|
let target: unknown[];
|
||||||
if (args[0] === "beforeRequest") {
|
if (args[0] === "beforeRequest") {
|
||||||
target = this.requestHooks;
|
target = this.requestHooks;
|
||||||
@@ -120,7 +120,7 @@ export class HTTPClient {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
clone() {
|
clone(): HTTPClient {
|
||||||
const child = new HTTPClient(this.options);
|
const child = new HTTPClient(this.options);
|
||||||
child.requestHooks = this.requestHooks.slice();
|
child.requestHooks = this.requestHooks.slice();
|
||||||
child.requestErrorHooks = this.requestErrorHooks.slice();
|
child.requestErrorHooks = this.requestErrorHooks.slice();
|
||||||
@@ -160,7 +160,7 @@ const codeRangeRE = new RegExp("^[0-9]xx$", "i");
|
|||||||
export function matchStatusCode(
|
export function matchStatusCode(
|
||||||
response: Response,
|
response: Response,
|
||||||
codes: number | string | (number | string)[],
|
codes: number | string | (number | string)[],
|
||||||
) {
|
): boolean {
|
||||||
const actual = `${response.status}`;
|
const actual = `${response.status}`;
|
||||||
const expectedCodes = Array.isArray(codes) ? codes : [codes];
|
const expectedCodes = Array.isArray(codes) ? codes : [codes];
|
||||||
if (!expectedCodes.length) {
|
if (!expectedCodes.length) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class ClientSDK {
|
|||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected createRequest$(conf: RequestConfig, options?: RequestOptions) {
|
protected createRequest$(conf: RequestConfig, options?: RequestOptions): Request {
|
||||||
const { method, path, query, headers: opHeaders, security } = conf;
|
const { method, path, query, headers: opHeaders, security } = conf;
|
||||||
|
|
||||||
const base = conf.baseURL ?? this.baseURL;
|
const base = conf.baseURL ?? this.baseURL;
|
||||||
@@ -109,7 +109,7 @@ export class ClientSDK {
|
|||||||
context: HookContext;
|
context: HookContext;
|
||||||
errorCodes: number | string | (number | string)[];
|
errorCodes: number | string | (number | string)[];
|
||||||
}
|
}
|
||||||
) {
|
): Promise<Response> {
|
||||||
const { context, errorCodes } = options;
|
const { context, errorCodes } = options;
|
||||||
|
|
||||||
let response = await this.client.request(await this.hooks$.beforeRequest(context, req));
|
let response = await this.client.request(await this.hooks$.beforeRequest(context, req));
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ function applyBearer(
|
|||||||
|
|
||||||
state.headers[spec.fieldName] = value;
|
state.headers[spec.fieldName] = value;
|
||||||
}
|
}
|
||||||
export function resolveGlobalSecurity(security: Partial<components.Security> | null | undefined) {
|
export function resolveGlobalSecurity(
|
||||||
|
security: Partial<components.Security> | null | undefined
|
||||||
|
): SecurityState | null {
|
||||||
return resolveSecurity([
|
return resolveSecurity([
|
||||||
{
|
{
|
||||||
fieldName: "X-Plex-Token",
|
fieldName: "X-Plex-Token",
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
const hasOwn = Object.prototype.hasOwnProperty;
|
const hasOwn = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
|
export type Params = Partial<Record<string, string | number>>;
|
||||||
|
|
||||||
export function pathToFunc(
|
export function pathToFunc(
|
||||||
pathPattern: string,
|
pathPattern: string,
|
||||||
options?: { charEncoding?: "percent" | "none" },
|
options?: { charEncoding?: "percent" | "none" },
|
||||||
): (params?: Record<string, string | number>) => string {
|
): (params?: Params) => string {
|
||||||
const paramRE = /\{([a-zA-Z0-9_]+?)\}/g;
|
const paramRE = /\{([a-zA-Z0-9_]+?)\}/g;
|
||||||
|
|
||||||
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class SDKValidationError extends Error {
|
|||||||
this.rawValue = rawValue;
|
this.rawValue = rawValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override toString() {
|
public override toString(): string {
|
||||||
return `${this.message}: ${this.cause}`;
|
return `${this.message}: ${this.cause}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ export class SDKValidationError extends Error {
|
|||||||
* is a ZodError or some other recognized error type, otherwise return the
|
* is a ZodError or some other recognized error type, otherwise return the
|
||||||
* default error message.
|
* default error message.
|
||||||
*/
|
*/
|
||||||
public pretty() {
|
public pretty(): string {
|
||||||
if (this.cause instanceof z.ZodError) {
|
if (this.cause instanceof z.ZodError) {
|
||||||
return `${this.message}\n${formatZodError(this.cause)}`;
|
return `${this.message}\n${formatZodError(this.cause)}`;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ export type ApplyUpdatesResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Tonight$ = z.nativeEnum(Tonight);
|
export const Tonight$: z.ZodNativeEnum<typeof Tonight> = z.nativeEnum(Tonight);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Skip$ = z.nativeEnum(Skip);
|
export const Skip$: z.ZodNativeEnum<typeof Skip> = z.nativeEnum(Skip);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace ApplyUpdatesRequest$ {
|
export namespace ApplyUpdatesRequest$ {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export type CheckForUpdatesResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Download$ = z.nativeEnum(Download);
|
export const Download$: z.ZodNativeEnum<typeof Download> = z.nativeEnum(Download);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace CheckForUpdatesRequest$ {
|
export namespace CheckForUpdatesRequest$ {
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ export type CreatePlaylistResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const QueryParamType$ = z.nativeEnum(QueryParamType);
|
export const QueryParamType$: z.ZodNativeEnum<typeof QueryParamType> = z.nativeEnum(QueryParamType);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Smart$ = z.nativeEnum(Smart);
|
export const Smart$: z.ZodNativeEnum<typeof Smart> = z.nativeEnum(Smart);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace CreatePlaylistRequest$ {
|
export namespace CreatePlaylistRequest$ {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export type GetGlobalHubsResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const OnlyTransient$ = z.nativeEnum(OnlyTransient);
|
export const OnlyTransient$: z.ZodNativeEnum<typeof OnlyTransient> = z.nativeEnum(OnlyTransient);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetGlobalHubsRequest$ {
|
export namespace GetGlobalHubsRequest$ {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export type GetLibraryResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const IncludeDetails$ = z.nativeEnum(IncludeDetails);
|
export const IncludeDetails$: z.ZodNativeEnum<typeof IncludeDetails> = z.nativeEnum(IncludeDetails);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetLibraryRequest$ {
|
export namespace GetLibraryRequest$ {
|
||||||
|
|||||||
@@ -170,7 +170,8 @@ export type GetLibraryHubsResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const QueryParamOnlyTransient$ = z.nativeEnum(QueryParamOnlyTransient);
|
export const QueryParamOnlyTransient$: z.ZodNativeEnum<typeof QueryParamOnlyTransient> =
|
||||||
|
z.nativeEnum(QueryParamOnlyTransient);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetLibraryHubsRequest$ {
|
export namespace GetLibraryHubsRequest$ {
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export type GetLibraryItemsResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Tag$ = z.nativeEnum(Tag);
|
export const Tag$: z.ZodNativeEnum<typeof Tag> = z.nativeEnum(Tag);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetLibraryItemsRequest$ {
|
export namespace GetLibraryItemsRequest$ {
|
||||||
|
|||||||
@@ -83,10 +83,11 @@ export type GetPlaylistsResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const PlaylistType$ = z.nativeEnum(PlaylistType);
|
export const PlaylistType$: z.ZodNativeEnum<typeof PlaylistType> = z.nativeEnum(PlaylistType);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const QueryParamSmart$ = z.nativeEnum(QueryParamSmart);
|
export const QueryParamSmart$: z.ZodNativeEnum<typeof QueryParamSmart> =
|
||||||
|
z.nativeEnum(QueryParamSmart);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetPlaylistsRequest$ {
|
export namespace GetPlaylistsRequest$ {
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ export type GetResizedPhotoResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const MinSize$ = z.nativeEnum(MinSize);
|
export const MinSize$: z.ZodNativeEnum<typeof MinSize> = z.nativeEnum(MinSize);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Upscale$ = z.nativeEnum(Upscale);
|
export const Upscale$: z.ZodNativeEnum<typeof Upscale> = z.nativeEnum(Upscale);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetResizedPhotoRequest$ {
|
export namespace GetResizedPhotoRequest$ {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export type GetTimelineResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const State$ = z.nativeEnum(State);
|
export const State$: z.ZodNativeEnum<typeof State> = z.nativeEnum(State);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetTimelineRequest$ {
|
export namespace GetTimelineRequest$ {
|
||||||
|
|||||||
@@ -45,10 +45,12 @@ export type GetTransientTokenResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const GetTransientTokenQueryParamType$ = z.nativeEnum(GetTransientTokenQueryParamType);
|
export const GetTransientTokenQueryParamType$: z.ZodNativeEnum<
|
||||||
|
typeof GetTransientTokenQueryParamType
|
||||||
|
> = z.nativeEnum(GetTransientTokenQueryParamType);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Scope$ = z.nativeEnum(Scope);
|
export const Scope$: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(Scope);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace GetTransientTokenRequest$ {
|
export namespace GetTransientTokenRequest$ {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export type LogLineResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Level$ = z.nativeEnum(Level);
|
export const Level$: z.ZodNativeEnum<typeof Level> = z.nativeEnum(Level);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace LogLineRequest$ {
|
export namespace LogLineRequest$ {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export type SearchLibraryResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Type$ = z.nativeEnum(Type);
|
export const Type$: z.ZodNativeEnum<typeof Type> = z.nativeEnum(Type);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace SearchLibraryRequest$ {
|
export namespace SearchLibraryRequest$ {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export type StartTaskResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const TaskName$ = z.nativeEnum(TaskName);
|
export const TaskName$: z.ZodNativeEnum<typeof TaskName> = z.nativeEnum(TaskName);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace StartTaskRequest$ {
|
export namespace StartTaskRequest$ {
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export type StopTaskResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const PathParamTaskName$ = z.nativeEnum(PathParamTaskName);
|
export const PathParamTaskName$: z.ZodNativeEnum<typeof PathParamTaskName> =
|
||||||
|
z.nativeEnum(PathParamTaskName);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace StopTaskRequest$ {
|
export namespace StopTaskRequest$ {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export type UploadPlaylistResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const Force$ = z.nativeEnum(Force);
|
export const Force$: z.ZodNativeEnum<typeof Force> = z.nativeEnum(Force);
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export namespace UploadPlaylistRequest$ {
|
export namespace UploadPlaylistRequest$ {
|
||||||
|
|||||||
@@ -50,77 +50,77 @@ export class PlexAPI extends ClientSDK {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _server?: Server;
|
private _server?: Server;
|
||||||
get server() {
|
get server(): Server {
|
||||||
return (this._server ??= new Server(this.options$));
|
return (this._server ??= new Server(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _media?: Media;
|
private _media?: Media;
|
||||||
get media() {
|
get media(): Media {
|
||||||
return (this._media ??= new Media(this.options$));
|
return (this._media ??= new Media(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _video?: Video;
|
private _video?: Video;
|
||||||
get video() {
|
get video(): Video {
|
||||||
return (this._video ??= new Video(this.options$));
|
return (this._video ??= new Video(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _activities?: Activities;
|
private _activities?: Activities;
|
||||||
get activities() {
|
get activities(): Activities {
|
||||||
return (this._activities ??= new Activities(this.options$));
|
return (this._activities ??= new Activities(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _butler?: Butler;
|
private _butler?: Butler;
|
||||||
get butler() {
|
get butler(): Butler {
|
||||||
return (this._butler ??= new Butler(this.options$));
|
return (this._butler ??= new Butler(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _hubs?: Hubs;
|
private _hubs?: Hubs;
|
||||||
get hubs() {
|
get hubs(): Hubs {
|
||||||
return (this._hubs ??= new Hubs(this.options$));
|
return (this._hubs ??= new Hubs(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _search?: Search;
|
private _search?: Search;
|
||||||
get search() {
|
get search(): Search {
|
||||||
return (this._search ??= new Search(this.options$));
|
return (this._search ??= new Search(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _library?: Library;
|
private _library?: Library;
|
||||||
get library() {
|
get library(): Library {
|
||||||
return (this._library ??= new Library(this.options$));
|
return (this._library ??= new Library(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _log?: Log;
|
private _log?: Log;
|
||||||
get log() {
|
get log(): Log {
|
||||||
return (this._log ??= new Log(this.options$));
|
return (this._log ??= new Log(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _plex?: Plex;
|
private _plex?: Plex;
|
||||||
get plex() {
|
get plex(): Plex {
|
||||||
return (this._plex ??= new Plex(this.options$));
|
return (this._plex ??= new Plex(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _playlists?: Playlists;
|
private _playlists?: Playlists;
|
||||||
get playlists() {
|
get playlists(): Playlists {
|
||||||
return (this._playlists ??= new Playlists(this.options$));
|
return (this._playlists ??= new Playlists(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _authentication?: Authentication;
|
private _authentication?: Authentication;
|
||||||
get authentication() {
|
get authentication(): Authentication {
|
||||||
return (this._authentication ??= new Authentication(this.options$));
|
return (this._authentication ??= new Authentication(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _statistics?: Statistics;
|
private _statistics?: Statistics;
|
||||||
get statistics() {
|
get statistics(): Statistics {
|
||||||
return (this._statistics ??= new Statistics(this.options$));
|
return (this._statistics ??= new Statistics(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _sessions?: Sessions;
|
private _sessions?: Sessions;
|
||||||
get sessions() {
|
get sessions(): Sessions {
|
||||||
return (this._sessions ??= new Sessions(this.options$));
|
return (this._sessions ??= new Sessions(this.options$));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _updater?: Updater;
|
private _updater?: Updater;
|
||||||
get updater() {
|
get updater(): Updater {
|
||||||
return (this._updater ??= new Updater(this.options$));
|
return (this._updater ??= new Updater(this.options$));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
import * as z from "zod";
|
import * as z from "zod";
|
||||||
|
|
||||||
export const blobLikeSchema = z.custom<Blob>(isBlobLike, {
|
export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
|
||||||
message: "expected a Blob, File or Blob-like object",
|
z.custom<Blob>(isBlobLike, {
|
||||||
fatal: true,
|
message: "expected a Blob, File or Blob-like object",
|
||||||
});
|
fatal: true,
|
||||||
|
});
|
||||||
|
|
||||||
export function isBlobLike(val: unknown): val is Blob {
|
export function isBlobLike(val: unknown): val is Blob {
|
||||||
if (val instanceof Blob) {
|
if (val instanceof Blob) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export type PageIterator<Result> = Result & {
|
|||||||
|
|
||||||
export function createPageIterator<Result>(
|
export function createPageIterator<Result>(
|
||||||
page: Result & { next: Paginator<Result> },
|
page: Result & { next: Paginator<Result> },
|
||||||
) {
|
): { [Symbol.asyncIterator]: () => AsyncIterableIterator<Result> } {
|
||||||
return {
|
return {
|
||||||
[Symbol.asyncIterator]: async function* paginator() {
|
[Symbol.asyncIterator]: async function* paginator() {
|
||||||
yield page;
|
yield page;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class RFCDate {
|
|||||||
/**
|
/**
|
||||||
* Creates a new RFCDate instance using today's date.
|
* Creates a new RFCDate instance using today's date.
|
||||||
*/
|
*/
|
||||||
static today() {
|
static today(): RFCDate {
|
||||||
return new RFCDate(new Date());
|
return new RFCDate(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user