comic-vine-sdk 2.0.0 → 2.0.1
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/lib/index.cjs +21 -15
- package/lib/index.cjs.map +2 -2
- package/lib/index.js +21 -15
- package/lib/index.js.map +1 -1
- package/package.json +25 -24
package/lib/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
8
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
9
9
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
10
|
var __spreadValues = (a, b) => {
|
|
11
11
|
for (var prop in b || (b = {}))
|
|
@@ -66,7 +66,7 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
66
66
|
} catch (e) {
|
|
67
67
|
no(e);
|
|
68
68
|
}
|
|
69
|
-
}, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {};
|
|
69
|
+
}, method = (k, call, wait, clear) => it[k] = (x) => (call = new Promise((yes, no, run) => (run = () => resume(k, x, yes, no), q ? q.then(run) : run())), clear = () => q === wait && (q = 0), q = wait = call.then(clear, clear), call), q, it = {};
|
|
70
70
|
return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -89,6 +89,9 @@ var init_status_code = __esm({
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
// src/errors/base-error.ts
|
|
92
|
+
function hasCaptureStackTrace(errorConstructor) {
|
|
93
|
+
return "captureStackTrace" in errorConstructor && typeof Reflect.get(errorConstructor, "captureStackTrace") === "function";
|
|
94
|
+
}
|
|
92
95
|
var import_core, BaseError;
|
|
93
96
|
var init_base_error = __esm({
|
|
94
97
|
"src/errors/base-error.ts"() {
|
|
@@ -98,8 +101,8 @@ var init_base_error = __esm({
|
|
|
98
101
|
constructor(details) {
|
|
99
102
|
super(details.message);
|
|
100
103
|
this.name = this.constructor.name;
|
|
101
|
-
if (Error
|
|
102
|
-
Error.captureStackTrace(this,
|
|
104
|
+
if (hasCaptureStackTrace(Error)) {
|
|
105
|
+
Error.captureStackTrace(this, new.target);
|
|
103
106
|
}
|
|
104
107
|
this.help = details.help;
|
|
105
108
|
}
|
|
@@ -431,20 +434,19 @@ var init_base_resource = __esm({
|
|
|
431
434
|
const defaultPageSize = 100;
|
|
432
435
|
const limit = (_a2 = options2 == null ? void 0 : options2.limit) != null ? _a2 : defaultPageSize;
|
|
433
436
|
let page = (options2 == null ? void 0 : options2.offset) ? options2.offset / limit + 1 : 1;
|
|
434
|
-
let hasMoreResults = true;
|
|
435
437
|
let response = yield new __await(fetchPagePromise);
|
|
436
|
-
|
|
438
|
+
while (true) {
|
|
437
439
|
for (const resource of response.data) {
|
|
438
440
|
yield resource;
|
|
439
441
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
response = yield new __await(fetchPage({
|
|
443
|
-
limit,
|
|
444
|
-
offset: response.numberOfPageResults * page++
|
|
445
|
-
}));
|
|
442
|
+
if (response.limit + response.offset >= response.numberOfTotalResults) {
|
|
443
|
+
break;
|
|
446
444
|
}
|
|
447
|
-
|
|
445
|
+
response = yield new __await(fetchPage({
|
|
446
|
+
limit,
|
|
447
|
+
offset: response.numberOfPageResults * page++
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
448
450
|
});
|
|
449
451
|
}
|
|
450
452
|
};
|
|
@@ -1191,7 +1193,9 @@ var init_options = __esm({
|
|
|
1191
1193
|
const validationError = error.issues[0];
|
|
1192
1194
|
if (validationError) {
|
|
1193
1195
|
throw new OptionsValidationError(
|
|
1194
|
-
validationError.path
|
|
1196
|
+
validationError.path.filter(
|
|
1197
|
+
(segment) => typeof segment === "string" || typeof segment === "number"
|
|
1198
|
+
),
|
|
1195
1199
|
validationError.message
|
|
1196
1200
|
);
|
|
1197
1201
|
}
|
|
@@ -1301,7 +1305,9 @@ var init_comic_vine = __esm({
|
|
|
1301
1305
|
);
|
|
1302
1306
|
this.resourceCache.set(propertyName, resource);
|
|
1303
1307
|
} catch (error) {
|
|
1304
|
-
throw new Error(`Failed to create resource '${className}': ${error}
|
|
1308
|
+
throw new Error(`Failed to create resource '${className}': ${error}`, {
|
|
1309
|
+
cause: error
|
|
1310
|
+
});
|
|
1305
1311
|
}
|
|
1306
1312
|
}
|
|
1307
1313
|
return this.resourceCache.get(propertyName);
|
package/lib/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/http-client/status-code.ts", "../src/errors/base-error.ts", "../src/errors/generic-error.ts", "../src/errors/custom-error.ts", "../src/errors/filter-error.ts", "../src/errors/generic-request-error.ts", "../src/errors/jsonp-callback-missing-error.ts", "../src/errors/object-not-found-error.ts", "../src/errors/options-validation-error.ts", "../src/errors/subscriber-only-error.ts", "../src/errors/unauthorized-error.ts", "../src/errors/url-format-error.ts", "../src/errors/index.ts", "../src/utils/is-object.ts", "../src/utils/case-converter.ts", "../src/http-client/hooks.ts", "../src/resources/base-resource.ts", "../src/resources/resource-type.ts", "../src/resources/character/character.ts", "../src/resources/character/index.ts", "../src/resources/concept/concept.ts", "../src/resources/concept/index.ts", "../src/resources/episode/episode.ts", "../src/resources/episode/index.ts", "../src/resources/issue/issue.ts", "../src/resources/issue/index.ts", "../src/resources/location/location.ts", "../src/resources/location/index.ts", "../src/resources/movie/movie.ts", "../src/resources/movie/index.ts", "../src/resources/origin/origin.ts", "../src/resources/origin/index.ts", "../src/resources/person/person.ts", "../src/resources/person/index.ts", "../src/resources/power/power.ts", "../src/resources/power/index.ts", "../src/resources/promo/promo.ts", "../src/resources/promo/index.ts", "../src/resources/publisher/publisher.ts", "../src/resources/publisher/index.ts", "../src/resources/series/series.ts", "../src/resources/series/index.ts", "../src/resources/story-arc/story-arc.ts", "../src/resources/story-arc/index.ts", "../src/resources/team/team.ts", "../src/resources/team/index.ts", "../src/resources/thing/thing.ts", "../src/resources/thing/index.ts", "../src/resources/video/video.ts", "../src/resources/video/index.ts", "../src/resources/video-category/video-category.ts", "../src/resources/video-category/index.ts", "../src/resources/video-type/video-type.ts", "../src/resources/video-type/index.ts", "../src/resources/volume/volume.ts", "../src/resources/volume/index.ts", "../src/resources/resource-list.ts", "../src/resources/resource-factory.ts", "../src/resources/resource-map.ts", "../src/resources/index.ts", "../src/utils/index.ts", "../src/http-client/url-builder.ts", "../src/options/index.ts", "../src/comic-vine.ts", "../src/types/http-client.ts", "../src/types/iso-date.ts", "../src/types/pick-filters.ts", "../src/types/request.ts", "../src/types/response.ts", "../src/types/url-builder.ts", "../src/types/valueof.ts", "../src/types/index.ts", "../src/index.ts", "../src/index-wrapper.cjs"],
|
|
4
|
-
"sourcesContent": ["export enum StatusCode {\n OK = 1,\n InvalidApiKey = 100,\n ObjectNotFound = 101,\n UrlFormatError = 102,\n JsonpCallbackMissing = 103,\n FilterError = 104,\n SubscriberOnlyVideo = 105,\n}\n", "import { HttpClientError } from '@http-client-toolkit/core';\n\ninterface ErrorDetails {\n message: string;\n help: string;\n}\n\nexport abstract class BaseError extends HttpClientError {\n public help: string;\n\n constructor(details: ErrorDetails) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(details.message);\n this.name = this.constructor.name;\n\n // Remove constructor invocation from the stack trace. Only available in V8.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n // Custom debugging information\n this.help = details.help;\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class GenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `An unexpected error occurred: ${message || 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { GenericError } from './generic-error.js';\n\nexport const customError = (error: unknown) => {\n if (error instanceof Error) {\n return new GenericError(error.message);\n }\n return new GenericError();\n};\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineFilterError extends BaseError {\n constructor() {\n super({\n message: 'There was a problem trying to filter the API results',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\n/**\n * @deprecated will be removed in the next major version, use ComicVineGenericRequestError instead!\n */\nexport class ComicVineGenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `Request to comic vine failed: ${message ?? 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n\nexport class ComicVineGenericRequestError extends ComicVineGenericError {\n constructor(message?: string) {\n super(message);\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicJsonpCallbackMissingError extends BaseError {\n constructor() {\n super({\n message: 'JSONP format requires a callback',\n help: 'This library does not use JSONP, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineObjectNotFoundError extends BaseError {\n constructor() {\n super({\n message:\n 'The requested resource could not be found in the Comic Vine API',\n help: 'Ensure you have used a valid resource Id',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class OptionsValidationError extends BaseError {\n constructor(path: Array<string | number>, message: string) {\n super({\n message: `Property: ${path.join('.')}, Problem: ${message}`,\n help: 'If the error message does not provide enough information or you believe there is a bug, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineSubscriberOnlyError extends BaseError {\n constructor() {\n super({\n message: 'The requested video is for subscribers only',\n help: 'Subscriber videos are part of a paid service, if you wish to upgrade you can do so here: https://comicvine.gamespot.com/upgrade/',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineUnauthorizedError extends BaseError {\n constructor() {\n super({\n message: 'Unauthorized response received when calling the Comic Vine API',\n help: 'Ensure you have a valid API key, you can get one from: https://comicvine.gamespot.com/api/',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineUrlFormatError extends BaseError {\n constructor() {\n super({\n message: 'The url for the request was not in the correct format',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "export * from './custom-error.js';\nexport * from './filter-error.js';\nexport * from './generic-error.js';\nexport * from './generic-request-error.js';\nexport * from './jsonp-callback-missing-error.js';\nexport * from './object-not-found-error.js';\nexport * from './options-validation-error.js';\nexport * from './subscriber-only-error.js';\nexport * from './unauthorized-error.js';\nexport * from './url-format-error.js';\n", "export const isObject = (maybeObject: unknown) =>\n maybeObject === Object(maybeObject) &&\n !Array.isArray(maybeObject) &&\n typeof maybeObject !== 'function';\n", "import { isObject } from './is-object.js';\n\nexport const toCamelCase = (str: string): string => {\n return str.replace(/([-_][a-z])/gi, ($1) => {\n return $1.toUpperCase().replace('-', '').replace('_', '');\n });\n};\n\nexport const toSnakeCase = (str: string) =>\n str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n\ntype CaseConverter = (str: string) => string;\n\nconst convertCase = (\n caseConverter: CaseConverter,\n object: unknown,\n): unknown => {\n if (isObject(object)) {\n const newObject: Record<string, unknown> = {};\n\n Object.keys(object as Record<string, unknown>).forEach((key) => {\n newObject[caseConverter(key)] = convertCase(\n caseConverter,\n (object as Record<string, unknown>)[key],\n );\n });\n\n return newObject;\n } else if (Array.isArray(object)) {\n return object.map((arrayElement) =>\n convertCase(caseConverter, arrayElement),\n );\n }\n\n return object;\n};\n\nexport const convertSnakeCaseToCamelCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toCamelCase, object) as ReturnType;\n};\n\nexport const convertCamelCaseToSnakeCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toSnakeCase, object) as ReturnType;\n};\n", "import type { HttpErrorContext } from '@http-client-toolkit/core';\nimport { StatusCode } from './status-code.js';\nimport {\n ComicVineFilterError,\n ComicJsonpCallbackMissingError,\n ComicVineObjectNotFoundError,\n ComicVineSubscriberOnlyError,\n ComicVineUrlFormatError,\n ComicVineUnauthorizedError,\n ComicVineGenericRequestError,\n} from '../errors/index.js';\nimport { convertSnakeCaseToCamelCase } from '../utils/case-converter.js';\n\n/**\n * Transforms snake_case API responses to camelCase.\n * Plugs into the toolkit's `responseTransformer` hook.\n */\nexport function comicVineResponseTransformer(data: unknown): unknown {\n return convertSnakeCaseToCamelCase(data);\n}\n\n/**\n * Checks Comic Vine application-level status codes and throws domain errors.\n * Plugs into the toolkit's `responseHandler` hook.\n *\n * Comic Vine returns 200 OK for application-level errors with a `statusCode`\n * field in the response body that indicates the actual result.\n */\nexport function comicVineResponseHandler(data: unknown): unknown {\n if (\n data !== null &&\n typeof data === 'object' &&\n 'statusCode' in data &&\n typeof (data as Record<string, unknown>).statusCode === 'number'\n ) {\n const statusCode = (data as Record<string, unknown>).statusCode as number;\n switch (statusCode) {\n case StatusCode.FilterError:\n throw new ComicVineFilterError();\n case StatusCode.JsonpCallbackMissing:\n throw new ComicJsonpCallbackMissingError();\n case StatusCode.ObjectNotFound:\n throw new ComicVineObjectNotFoundError();\n case StatusCode.SubscriberOnlyVideo:\n throw new ComicVineSubscriberOnlyError();\n case StatusCode.UrlFormatError:\n throw new ComicVineUrlFormatError();\n }\n }\n return data;\n}\n\n/**\n * Maps HTTP errors to Comic Vine domain-specific errors.\n * Plugs into the toolkit's `errorHandler` hook.\n */\nexport function comicVineErrorHandler(context: HttpErrorContext): Error {\n if (context.response.status === 401) {\n return new ComicVineUnauthorizedError();\n }\n\n const bodyMessage =\n typeof context.response.data === 'object' && context.response.data !== null\n ? (context.response.data as { message?: string }).message\n : undefined;\n const message = bodyMessage\n ? `${context.message}, ${bodyMessage}`\n : context.message;\n return new ComicVineGenericRequestError(message);\n}\n", "import { ResourceType } from './resource-type.js';\nimport type {\n RetrieveOptions,\n ListOptions,\n HttpClient,\n UrlBuilder,\n PickFilters,\n} from '../types/index.js';\nimport type { Response } from '../types/response.js';\n\n// Common interface that all resources must implement\nexport interface ResourceInterface {\n retrieve(id: number, options?: Record<string, unknown>): Promise<unknown>;\n list(\n options?: Record<string, unknown>,\n ): Promise<unknown> & AsyncIterable<unknown>;\n}\n\nexport abstract class BaseResource<Resource, ResourceListItem>\n implements ResourceInterface\n{\n protected abstract resourceType: ResourceType;\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n async retrieve<FieldKey extends keyof Resource>(\n id: number,\n options?: RetrieveOptions<FieldKey>,\n ) {\n type ReturnType<T> = T extends object ? Pick<Resource, FieldKey> : Resource;\n\n const url = this.urlBuilder.retrieve(this.resourceType, id, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<ResponseType>>(url, {\n priority: options?.priority,\n });\n\n return response.results;\n }\n\n private async fetchPage<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n type ReturnType<T> = T extends object\n ? Pick<ResourceListItem, FieldKey>\n : ResourceListItem;\n\n const url = this.urlBuilder.list(this.resourceType, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<Array<ResponseType>>>(\n url,\n {\n priority: options?.priority,\n },\n );\n\n return {\n limit: response.limit,\n numberOfPageResults: response.numberOfPageResults,\n numberOfTotalResults: response.numberOfTotalResults,\n offset: response.offset,\n data: response.results,\n };\n }\n\n list<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n // Proxy the call to this.fetchPage so that we can close over `this`, allowing access in the iterator\n const fetchPage = (opts?: Parameters<typeof this.fetchPage>[0]) =>\n this.fetchPage.call(this, opts);\n const fetchPagePromise = fetchPage(options);\n\n const asyncIterator = {\n async *[Symbol.asyncIterator]() {\n const defaultPageSize = 100;\n const limit = options?.limit ?? defaultPageSize;\n let page = options?.offset ? options.offset / limit + 1 : 1;\n let hasMoreResults = true;\n let response = await fetchPagePromise;\n\n do {\n for (const resource of response.data) {\n yield resource;\n }\n\n hasMoreResults =\n response.limit + response.offset < response.numberOfTotalResults;\n\n if (hasMoreResults) {\n response = await fetchPage({\n limit,\n offset: response.numberOfPageResults * page++,\n });\n }\n } while (hasMoreResults);\n },\n };\n\n const promiseWithAsyncIterator = Object.assign(\n fetchPagePromise,\n asyncIterator,\n );\n\n return promiseWithAsyncIterator;\n }\n}\n", "/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\nexport enum ResourceType {\n Character = 4005,\n Concept = 4015,\n Episode = 4070,\n Issue = 4000,\n Location = 4020,\n Movie = 4025,\n Origin = 4030,\n Person = 4040,\n Power = 4035,\n Promo = 1700,\n Publisher = 4010,\n Series = 4075,\n StoryArc = 4045,\n Team = 4060,\n Thing = 4055,\n Video = 2300,\n VideoCategory = 2320,\n VideoType = 2320,\n Volume = 4050,\n}\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { CharacterDetails, CharacterListItem } from './types/index.js';\n\nexport class Character extends BaseResource<\n CharacterDetails,\n CharacterListItem\n> {\n protected resourceType: ResourceType = ResourceType.Character;\n}\n", "export * from './character.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ConceptDetails, ConceptListItem } from './types/index.js';\n\nexport class Concept extends BaseResource<ConceptDetails, ConceptListItem> {\n protected resourceType: ResourceType = ResourceType.Concept;\n}\n", "export * from './concept.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { EpisodeDetails, EpisodeListItem } from './types/index.js';\n\nexport class Episode extends BaseResource<EpisodeDetails, EpisodeListItem> {\n protected resourceType: ResourceType = ResourceType.Episode;\n}\n", "export * from './episode.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { IssueDetails, IssueListItem } from './types/index.js';\n\nexport class Issue extends BaseResource<IssueDetails, IssueListItem> {\n protected resourceType: ResourceType = ResourceType.Issue;\n}\n", "export * from './issue.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { LocationDetails, LocationListItem } from './types/index.js';\n\nexport class Location extends BaseResource<LocationDetails, LocationListItem> {\n protected resourceType: ResourceType = ResourceType.Location;\n}\n", "export * from './location.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { MovieDetails, MovieListItem } from './types/index.js';\n\nexport class Movie extends BaseResource<MovieDetails, MovieListItem> {\n protected resourceType: ResourceType = ResourceType.Movie;\n}\n", "export * from './movie.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { OriginDetails, OriginListItem } from './types/index.js';\n\nexport class Origin extends BaseResource<OriginDetails, OriginListItem> {\n protected resourceType: ResourceType = ResourceType.Origin;\n}\n", "export * from './origin.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PersonDetails, PersonListItem } from './types/index.js';\n\nexport class Person extends BaseResource<PersonDetails, PersonListItem> {\n protected resourceType: ResourceType = ResourceType.Person;\n}\n", "export * from './person.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PowerDetails, PowerListItem } from './types/index.js';\n\nexport class Power extends BaseResource<PowerDetails, PowerListItem> {\n protected resourceType: ResourceType = ResourceType.Power;\n}\n", "export * from './power.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PromoDetails, PromoListItem } from './types/index.js';\n\nexport class Promo extends BaseResource<PromoDetails, PromoListItem> {\n protected resourceType: ResourceType = ResourceType.Promo;\n}\n", "export * from './promo.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PublisherDetails, PublisherListItem } from './types/index.js';\n\nexport class Publisher extends BaseResource<\n PublisherDetails,\n PublisherListItem\n> {\n protected resourceType: ResourceType = ResourceType.Publisher;\n}\n", "export * from './publisher.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { SeriesDetails, SeriesListItem } from './types/index.js';\n\nexport class Series extends BaseResource<SeriesDetails, SeriesListItem> {\n protected resourceType: ResourceType = ResourceType.Series;\n}\n", "export * from './series.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { StoryArcDetails, StoryArcListItem } from './types/index.js';\n\nexport class StoryArc extends BaseResource<StoryArcDetails, StoryArcListItem> {\n protected resourceType: ResourceType = ResourceType.StoryArc;\n}\n", "export * from './story-arc.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { TeamDetails, TeamListItem } from './types/index.js';\n\nexport class Team extends BaseResource<TeamDetails, TeamListItem> {\n protected resourceType: ResourceType = ResourceType.Team;\n}\n", "export * from './team.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ThingDetails, ThingListItem } from './types/index.js';\n\nexport class Thing extends BaseResource<ThingDetails, ThingListItem> {\n protected resourceType: ResourceType = ResourceType.Thing;\n}\n", "export * from './thing.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoDetails, VideoListItem } from './types/index.js';\n\nexport class Video extends BaseResource<VideoDetails, VideoListItem> {\n protected resourceType: ResourceType = ResourceType.Video;\n}\n", "export * from './video.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoCategoryDetails, VideoCategoryListItem } from './types/index.js';\n\nexport class VideoCategory extends BaseResource<\n VideoCategoryDetails,\n VideoCategoryListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoCategory;\n}\n", "export * from './video-category.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoTypeDetails, VideoTypeListItem } from './types/index.js';\n\nexport class VideoType extends BaseResource<\n VideoTypeDetails,\n VideoTypeListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoType;\n}\n", "export * from './video-type.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VolumeDetails, VolumeListItem } from './types/index.js';\n\nexport class Volume extends BaseResource<VolumeDetails, VolumeListItem> {\n protected resourceType: ResourceType = ResourceType.Volume;\n}\n", "export * from './volume.js';\n", "export * from './character/index.js';\nexport * from './concept/index.js';\nexport * from './episode/index.js';\nexport * from './issue/index.js';\nexport * from './location/index.js';\nexport * from './movie/index.js';\nexport * from './origin/index.js';\nexport * from './person/index.js';\nexport * from './power/index.js';\nexport * from './promo/index.js';\nexport * from './publisher/index.js';\nexport * from './series/index.js';\nexport * from './story-arc/index.js';\nexport * from './team/index.js';\nexport * from './thing/index.js';\nexport * from './video/index.js';\nexport * from './video-category/index.js';\nexport * from './video-type/index.js';\nexport * from './volume/index.js';\n", "import * as resources from './resource-list.js';\nimport { HttpClient, UrlBuilder } from '../types/index.js';\n\nexport class ResourceFactory {\n private _resources = { ...resources };\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n public create<T extends keyof typeof this._resources>(\n name: T,\n ): InstanceType<(typeof this._resources)[T]>;\n public create(\n name: keyof typeof this._resources,\n ): InstanceType<(typeof this._resources)[keyof typeof this._resources]> {\n if (!this._resources[name]) {\n throw new Error(`${name} resource not implemented`);\n }\n const ResourceClass = this._resources[name] as new (\n httpClient: HttpClient,\n urlBuilder: UrlBuilder,\n ) => InstanceType<(typeof this._resources)[keyof typeof this._resources]>;\n return new ResourceClass(this.httpClient, this.urlBuilder);\n }\n}\n", "import { ResourceType } from './resource-type.js';\n\ninterface Resource {\n detailName: string;\n listName: string;\n}\n\nconst resourceMap = new Map<ResourceType, Resource>([\n [ResourceType.Character, { detailName: 'character', listName: 'characters' }],\n [ResourceType.Concept, { detailName: 'concept', listName: 'concepts' }],\n [ResourceType.Episode, { detailName: 'episode', listName: 'episodes' }],\n [ResourceType.Issue, { detailName: 'issue', listName: 'issues' }],\n [ResourceType.Location, { detailName: 'location', listName: 'locations' }],\n [ResourceType.Movie, { detailName: 'movie', listName: 'movies' }],\n [ResourceType.Origin, { detailName: 'origin', listName: 'origins' }],\n [ResourceType.Person, { detailName: 'person', listName: 'people' }],\n [ResourceType.Power, { detailName: 'power', listName: 'powers' }],\n [ResourceType.Promo, { detailName: 'promo', listName: 'promos' }],\n [ResourceType.Publisher, { detailName: 'publisher', listName: 'publishers' }],\n [ResourceType.Series, { detailName: 'series', listName: 'series_list' }],\n [ResourceType.StoryArc, { detailName: 'story_arc', listName: 'story_arcs' }],\n [ResourceType.Team, { detailName: 'team', listName: 'teams' }],\n [ResourceType.Thing, { detailName: 'object', listName: 'objects' }],\n [ResourceType.Video, { detailName: 'video', listName: 'videos' }],\n [\n ResourceType.VideoCategory,\n { detailName: 'video_category', listName: 'video_categories' },\n ],\n [\n ResourceType.VideoType,\n { detailName: 'video_type', listName: 'video_types' },\n ],\n [ResourceType.Volume, { detailName: 'volume', listName: 'volumes' }],\n]);\n\nexport const getResource = (resourceType: ResourceType) => {\n const resource = resourceMap.get(resourceType);\n if (!resource) {\n throw new Error(`Resource type (${resourceType}) not found`);\n }\n return resource;\n};\n", "export * from './resource-factory.js';\nexport * from './resource-map.js';\nexport * from './resource-type.js';\n", "export * from './case-converter.js';\nexport * from './is-object.js';\n", "import { getResource, ResourceType } from '../resources/index.js';\nimport { RetrieveOptions, ListOptions, Sort } from '../types/index.js';\nimport { toSnakeCase, convertCamelCaseToSnakeCase } from '../utils/index.js';\n\nconst isDefined = <T>(value: T): value is NonNullable<T> => {\n return value != null;\n};\n\ninterface QueryParam {\n name: string;\n value: string | number;\n}\n\nexport class UrlBuilder {\n constructor(\n private apiKey: string,\n private baseUrl: string,\n ) {}\n\n private getParam(key: string, value: string | number | undefined) {\n if (value) {\n return { name: toSnakeCase(key), value };\n }\n\n return undefined;\n }\n\n private getFormatParm() {\n return { name: 'format', value: `json` };\n }\n\n private getApiKeyParm() {\n return { name: 'api_key', value: this.apiKey };\n }\n\n private getSortParam(sort?: Sort) {\n if (sort) {\n return { name: 'sort', value: `${sort.field}:${sort.direction}` };\n }\n\n return undefined;\n }\n\n private getLimitParam(limit?: number) {\n if (limit) {\n return this.getParam('limit', limit);\n }\n\n return undefined;\n }\n\n private getOffsetParam(offset?: number) {\n if (offset) {\n return this.getParam('offset', offset);\n }\n\n return undefined;\n }\n\n private getFieldListParams<Key>(fieldList: Array<Key> | undefined) {\n if (fieldList) {\n return {\n name: 'field_list',\n value: fieldList.map((field) => toSnakeCase(String(field))).join(','),\n };\n }\n\n return undefined;\n }\n\n private getFilterParams<FilterType>(filter: FilterType | undefined) {\n if (filter) {\n const snakeCaseFilter =\n convertCamelCaseToSnakeCase<Record<string, unknown>>(filter);\n const filterParams = Object.entries<unknown>(snakeCaseFilter).map(\n ([key, value]) => `${key}:${value}`,\n );\n\n return { name: 'filter', value: filterParams.join(',') };\n }\n\n return undefined;\n }\n\n private buildUrl(\n urlInput: string,\n queryParams: Array<QueryParam | undefined>,\n ) {\n const url = new URL(urlInput, this.baseUrl);\n const urlSearchParams = new URLSearchParams(\n queryParams\n .filter(isDefined)\n .map<[string, string]>((param) => [param.name, param.value.toString()]),\n );\n\n url.search = urlSearchParams.toString();\n\n return url.toString();\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @param id A unique identifier for the resource\n * @returns A url for requesting the resource\n * @example https://comicvine.gamespot.com/api/issue/4000-719442?format=json&api_key=123abc\n */\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n options?: RetrieveOptions<Key>,\n ) {\n const resource = getResource(resourceType);\n const urlInput = `${resource.detailName}/${resourceType}-${id}`;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getFieldListParams(options?.fieldList),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @returns A url for requesting a list of resources\n * @example https://comicvine.gamespot.com/api/issues?format=json&api_key=123abc\n */\n list<Resource, FilterType>(\n resourceType: ResourceType,\n options?: ListOptions<Resource, FilterType>,\n ) {\n const urlInput = getResource(resourceType).listName;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getLimitParam(options?.limit),\n this.getOffsetParam(options?.offset),\n this.getSortParam(options?.sort),\n this.getFieldListParams(options?.fieldList),\n this.getFilterParams(options?.filter),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n}\n", "import { z, ZodError } from 'zod';\nimport { customError, OptionsValidationError } from '../errors/index.js';\n\nconst options = z.object({\n /**\n * The base url for the Comic Vine API.\n * This could be used to set a proxy when using the library in a browser.\n * It also ensures that if the comic vine url was to change it wouldn't be a breaking change to the library.\n * @default https://comicvine.gamespot.com/api/\n */\n baseUrl: z\n .string()\n .url()\n .optional()\n .default('https://comicvine.gamespot.com/api/'),\n});\n\nexport type userOptions = z.input<typeof options>;\nexport type Options = z.output<typeof options>;\n\nexport const loadOptions = (userOptions?: userOptions) => {\n try {\n return options.parse(userOptions ?? {});\n } catch (error: unknown) {\n if (error instanceof ZodError) {\n const validationError = error.issues[0];\n if (validationError) {\n throw new OptionsValidationError(\n validationError.path,\n validationError.message,\n );\n }\n throw new OptionsValidationError([], 'Unknown validation error');\n }\n throw customError(error);\n }\n};\n", "import {\n HttpClient,\n type CacheStore,\n type DedupeStore,\n type RateLimitStore,\n} from '@http-client-toolkit/core';\nimport {\n comicVineResponseTransformer,\n comicVineResponseHandler,\n comicVineErrorHandler,\n} from './http-client/hooks.js';\nimport { UrlBuilder } from './http-client/url-builder.js';\nimport { loadOptions } from './options/index.js';\nimport type { ResourceInterface } from './resources/base-resource.js';\nimport { ResourceFactory } from './resources/index.js';\nimport * as resources from './resources/resource-list.js';\nimport { getResource } from './resources/resource-map.js';\nimport { ResourceType } from './resources/resource-type.js';\nimport { toSnakeCase } from './utils/index.js';\n\nfunction classNameToPropertyName(className: string): string {\n if (!className) {\n return '';\n }\n return className.charAt(0).toLowerCase() + className.slice(1);\n}\n\ntype ResourceInstance = ReturnType<ResourceFactory['create']> &\n ResourceInterface;\n\n// Create resource property type mapping dynamically\ntype ResourcePropertyMap = {\n [K in keyof typeof resources as Uncapitalize<K>]: InstanceType<\n (typeof resources)[K]\n >;\n};\n\nconst resourceMappings = Object.values(ResourceType)\n .filter((value): value is ResourceType => typeof value === 'number')\n .map((resourceType) => getResource(resourceType));\n\nconst canonicalRateLimitResourceNames = new Map<string, string>();\nfor (const { detailName, listName } of resourceMappings) {\n canonicalRateLimitResourceNames.set(detailName, listName);\n canonicalRateLimitResourceNames.set(listName, listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(detailName), listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(listName), listName);\n}\n\nfunction normalizeRateLimitResourceName(resourceName: string): string {\n return (\n canonicalRateLimitResourceNames.get(toSnakeCase(resourceName)) ??\n resourceName\n );\n}\n\nfunction inferComicVineRateLimitResource(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n const segments = pathname.split('/').filter(Boolean);\n const apiIndex = segments.indexOf('api');\n const endpoint = apiIndex >= 0 ? segments[apiIndex + 1] : segments[0];\n\n if (!endpoint) {\n return 'unknown';\n }\n\n return normalizeRateLimitResourceName(endpoint);\n } catch {\n return 'unknown';\n }\n}\n\n/**\n * Consolidated options interface for ComicVine client\n */\nexport interface ComicVineOptions {\n /** Comic Vine API key */\n apiKey: string;\n\n /** Base URL for the Comic Vine API */\n baseUrl?: string;\n\n /** Store implementations for caching, deduplication, and rate limiting */\n stores?: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n /** HTTP client configuration */\n client?: {\n /** Default cache TTL in seconds */\n defaultCacheTTL?: number;\n /** Whether to throw errors on rate limit violations */\n throwOnRateLimit?: boolean;\n /** Maximum time to wait for rate limit in milliseconds */\n maxWaitTime?: number;\n };\n}\n\nexport class ComicVine implements ResourcePropertyMap {\n private resourceFactory: ResourceFactory;\n private resourceCache = new Map<string, ResourceInstance>();\n private resourceNames: Array<string>;\n private stores: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n // TypeScript property declarations for static typing (will be provided by Proxy)\n declare readonly character: ResourcePropertyMap['character'];\n declare readonly concept: ResourcePropertyMap['concept'];\n declare readonly episode: ResourcePropertyMap['episode'];\n declare readonly issue: ResourcePropertyMap['issue'];\n declare readonly location: ResourcePropertyMap['location'];\n declare readonly movie: ResourcePropertyMap['movie'];\n declare readonly origin: ResourcePropertyMap['origin'];\n declare readonly person: ResourcePropertyMap['person'];\n declare readonly power: ResourcePropertyMap['power'];\n declare readonly promo: ResourcePropertyMap['promo'];\n declare readonly publisher: ResourcePropertyMap['publisher'];\n declare readonly series: ResourcePropertyMap['series'];\n declare readonly storyArc: ResourcePropertyMap['storyArc'];\n declare readonly team: ResourcePropertyMap['team'];\n declare readonly thing: ResourcePropertyMap['thing'];\n declare readonly video: ResourcePropertyMap['video'];\n declare readonly videoCategory: ResourcePropertyMap['videoCategory'];\n declare readonly videoType: ResourcePropertyMap['videoType'];\n declare readonly volume: ResourcePropertyMap['volume'];\n\n /**\n * Create a new ComicVine client\n * @param options - Configuration options for the client\n */\n constructor(options: ComicVineOptions) {\n const { apiKey, baseUrl, stores = {}, client = {} } = options;\n\n const _options = loadOptions({ baseUrl });\n\n const httpClient = new HttpClient({\n name: 'comic-vine-sdk',\n cache: stores.cache\n ? {\n store: stores.cache,\n ttl: client.defaultCacheTTL,\n }\n : undefined,\n dedupe: stores.dedupe,\n rateLimit: stores.rateLimit\n ? {\n store: stores.rateLimit,\n throw: client.throwOnRateLimit,\n maxWaitTime: client.maxWaitTime,\n }\n : undefined,\n responseTransformer: comicVineResponseTransformer,\n responseHandler: comicVineResponseHandler,\n errorHandler: comicVineErrorHandler,\n resourceKeyResolver: inferComicVineRateLimitResource,\n });\n const urlBuilder = new UrlBuilder(apiKey, _options.baseUrl);\n\n this.resourceFactory = new ResourceFactory(httpClient, urlBuilder);\n this.stores = stores;\n\n // Discover available resources dynamically\n this.resourceNames = Object.keys(resources);\n\n // Return a proxy that provides lazy loading with full type safety\n return new Proxy(this, {\n get(target, prop: string | symbol) {\n if (typeof prop === 'string' && target.isResourceProperty(prop)) {\n return target.getResource(prop);\n }\n return Reflect.get(target, prop);\n },\n }) as ComicVine;\n }\n\n private isResourceProperty(prop: string): boolean {\n // Check if this property corresponds to a known resource\n const className = prop.charAt(0).toUpperCase() + prop.slice(1);\n return this.resourceNames.includes(className);\n }\n\n private getResource(propertyName: string): ResourceInstance {\n // Lazy loading: create resource only when first accessed\n if (!this.resourceCache.has(propertyName)) {\n const className =\n propertyName.charAt(0).toUpperCase() + propertyName.slice(1);\n try {\n const resource = this.resourceFactory.create(\n className as keyof typeof resources,\n );\n\n this.resourceCache.set(propertyName, resource);\n } catch (error) {\n throw new Error(`Failed to create resource '${className}': ${error}`);\n }\n }\n return this.resourceCache.get(propertyName)!;\n }\n\n getAvailableResources(): Array<string> {\n return this.resourceNames.map((name) => classNameToPropertyName(name));\n }\n\n hasResource(resourceName: string): boolean {\n return this.isResourceProperty(resourceName);\n }\n\n getResourceByName(resourceName: string): ResourceInstance | undefined {\n if (!this.isResourceProperty(resourceName)) {\n return undefined;\n }\n return this.getResource(resourceName);\n }\n\n isResourceLoaded(resourceName: string): boolean {\n return this.resourceCache.has(resourceName);\n }\n\n getCacheStats(): {\n total: number;\n loaded: number;\n loadedResources: Array<string>;\n } {\n const total = this.resourceNames.length;\n const loaded = this.resourceCache.size;\n const loadedResources = Array.from(this.resourceCache.keys());\n return { total, loaded, loadedResources };\n }\n\n async clearCache(): Promise<void> {\n if (this.stores.cache) {\n await this.stores.cache.clear();\n }\n }\n\n async getRateLimitStatus(resourceName: string) {\n if (this.stores.rateLimit) {\n return this.stores.rateLimit.getStatus(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n return null;\n }\n\n async resetRateLimit(resourceName: string): Promise<void> {\n if (this.stores.rateLimit) {\n await this.stores.rateLimit.reset(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n }\n}\n", "export type { HttpClientContract as HttpClient } from '@http-client-toolkit/core';\n", "type digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;\ntype oneToNine = Exclude<digit, 0>;\n\ntype YYYY = `19${digit}${digit}` | `20${digit}${digit}`;\ntype MM = `0${oneToNine}` | `1${0 | 1 | 2}`;\ntype DD = `${0}${oneToNine}` | `${1 | 2}${digit}` | `3${0 | 1}`;\n\nexport type IsoDate = `${YYYY}-${MM}-${DD}`;\n", "type KeysMatching<T, V> = {\n [K in keyof T]-?: T[K] extends V ? K : never;\n}[keyof T];\n\ntype PickMatching<T, V> = Pick<T, KeysMatching<T, V>>;\n\nexport type PickFilters<T> = Partial<\n PickMatching<T, number> & PickMatching<T, string | null>\n>;\n", "import type { RequestPriority } from '@http-client-toolkit/core';\n\nexport interface BaseOptions<FieldKey> {\n /**\n * List of field names to include in the response.\n * Use this if you want to reduce the size of the response payload\n */\n fieldList?: Array<FieldKey>;\n}\n\nexport interface PriorityOptions {\n /**\n * Priority level for the request (affects rate limiting behavior)\n * - 'user': High priority, gets reserved capacity during activity\n * - 'background': Lower priority, may be throttled during high user activity\n */\n priority?: RequestPriority;\n}\n\nexport interface RetrieveOptions<FieldKey>\n extends BaseOptions<FieldKey>,\n PriorityOptions {}\n\nexport interface ListOptions<FieldKey, Filter>\n extends BaseOptions<FieldKey>,\n PriorityOptions {\n /**\n * The number of results to display per page\n * This value defaults to 100 and can not exceed this number\n */\n limit?: number;\n\n /**\n * Return results starting with the object at the offset specified\n */\n offset?: number;\n\n /**\n * The result set can be sorted by field in ascending or descending order\n */\n sort?: Sort;\n\n /**\n * The results can be filtered by field\n */\n filter?: Filter;\n}\n\nexport interface Sort {\n field: string;\n direction: 'asc' | 'desc';\n}\n", "import { StatusCode } from '../http-client/status-code.js';\n\nexport interface Response<Result> {\n // A text string representing the status_code\n error: 'OK';\n // The value of the limit filter specified, or 100 if not specified\n limit: number;\n // The value of the offset filter specified, or 0 if not specified\n offset: number;\n // The number of results on this page\n numberOfPageResults: number;\n // The number of total results matching the filter conditions specified\n numberOfTotalResults: number;\n // An integer indicating the result of the request\n statusCode: StatusCode;\n // Zero or more items that match the filters specified\n results: Result;\n}\n", "import { RetrieveOptions, ListOptions } from './index.js';\nimport { ResourceType } from '../resources/resource-type.js';\n\nexport interface UrlBuilder {\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n requestOptions?: RetrieveOptions<Key> | undefined,\n ): string;\n\n list<Resource, FilterType>(\n resourceType: ResourceType,\n requestOptions?: ListOptions<Resource, FilterType> | undefined,\n ): string;\n}\n", "export type ValueOf<T> = T[keyof T];\n", "export * from './http-client.js';\nexport * from './iso-date.js';\nexport * from './pick-filters.js';\nexport * from './request.js';\nexport * from './response.js';\nexport * from './url-builder.js';\nexport * from './valueof.js';\n", "import { ComicVine } from './comic-vine.js';\nimport { StatusCode } from './http-client/status-code.js';\n\nexport default ComicVine;\n\n// Named exports for better tree-shaking\nexport { ComicVine };\n\n// Export all error types\nexport * from './errors/index.js';\n\n// Export all types\nexport * from './types/index.js';\n\n// Export Comic Vine specific HTTP utilities\nexport { StatusCode };\n\n// Re-export client options\nexport type { ComicVineOptions } from './comic-vine.js';\n", "/* eslint-disable @typescript-eslint/no-require-imports */\nconst esm = require('./index');\n\nmodule.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,YAAY;AAAA,YAC7C;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF;AAAA;AAAA;;;ACjQA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,oBAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA,IAAAC;AACA;AAAA;AAAA;;;ACNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAGO;AAHP;AAAA;AAAA;AAAA;AACA;AAQA;AAGA;AATA,IAAO,gBAAQ;AAAA;AAAA;;;ACFf,IAAM,MAAM;AAEZ,OAAO,UAAU,OAAO,OAAO,IAAI,SAAS,GAAG;",
|
|
4
|
+
"sourcesContent": ["export enum StatusCode {\n OK = 1,\n InvalidApiKey = 100,\n ObjectNotFound = 101,\n UrlFormatError = 102,\n JsonpCallbackMissing = 103,\n FilterError = 104,\n SubscriberOnlyVideo = 105,\n}\n", "import { HttpClientError } from '@http-client-toolkit/core';\n\ninterface ErrorDetails {\n message: string;\n help: string;\n}\n\ntype CaptureStackTrace = (\n targetObject: object,\n constructorOpt?: abstract new (...args: Array<never>) => object,\n) => void;\n\ninterface V8ErrorConstructor extends ErrorConstructor {\n captureStackTrace: CaptureStackTrace;\n}\n\nfunction hasCaptureStackTrace(\n errorConstructor: ErrorConstructor,\n): errorConstructor is V8ErrorConstructor {\n return (\n 'captureStackTrace' in errorConstructor &&\n typeof Reflect.get(errorConstructor, 'captureStackTrace') === 'function'\n );\n}\n\nexport abstract class BaseError extends HttpClientError {\n public help: string;\n\n constructor(details: ErrorDetails) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(details.message);\n this.name = this.constructor.name;\n\n // Remove constructor invocation from the stack trace. Only available in V8.\n if (hasCaptureStackTrace(Error)) {\n Error.captureStackTrace(this, new.target);\n }\n\n // Custom debugging information\n this.help = details.help;\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class GenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `An unexpected error occurred: ${message || 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { GenericError } from './generic-error.js';\n\nexport const customError = (error: unknown) => {\n if (error instanceof Error) {\n return new GenericError(error.message);\n }\n return new GenericError();\n};\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineFilterError extends BaseError {\n constructor() {\n super({\n message: 'There was a problem trying to filter the API results',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\n/**\n * @deprecated will be removed in the next major version, use ComicVineGenericRequestError instead!\n */\nexport class ComicVineGenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `Request to comic vine failed: ${message ?? 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n\nexport class ComicVineGenericRequestError extends ComicVineGenericError {\n constructor(message?: string) {\n super(message);\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicJsonpCallbackMissingError extends BaseError {\n constructor() {\n super({\n message: 'JSONP format requires a callback',\n help: 'This library does not use JSONP, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineObjectNotFoundError extends BaseError {\n constructor() {\n super({\n message:\n 'The requested resource could not be found in the Comic Vine API',\n help: 'Ensure you have used a valid resource Id',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class OptionsValidationError extends BaseError {\n constructor(path: Array<string | number>, message: string) {\n super({\n message: `Property: ${path.join('.')}, Problem: ${message}`,\n help: 'If the error message does not provide enough information or you believe there is a bug, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineSubscriberOnlyError extends BaseError {\n constructor() {\n super({\n message: 'The requested video is for subscribers only',\n help: 'Subscriber videos are part of a paid service, if you wish to upgrade you can do so here: https://comicvine.gamespot.com/upgrade/',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineUnauthorizedError extends BaseError {\n constructor() {\n super({\n message: 'Unauthorized response received when calling the Comic Vine API',\n help: 'Ensure you have a valid API key, you can get one from: https://comicvine.gamespot.com/api/',\n });\n }\n}\n", "import { BaseError } from './base-error.js';\n\nexport class ComicVineUrlFormatError extends BaseError {\n constructor() {\n super({\n message: 'The url for the request was not in the correct format',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n", "export * from './custom-error.js';\nexport * from './filter-error.js';\nexport * from './generic-error.js';\nexport * from './generic-request-error.js';\nexport * from './jsonp-callback-missing-error.js';\nexport * from './object-not-found-error.js';\nexport * from './options-validation-error.js';\nexport * from './subscriber-only-error.js';\nexport * from './unauthorized-error.js';\nexport * from './url-format-error.js';\n", "export const isObject = (maybeObject: unknown) =>\n maybeObject === Object(maybeObject) &&\n !Array.isArray(maybeObject) &&\n typeof maybeObject !== 'function';\n", "import { isObject } from './is-object.js';\n\nexport const toCamelCase = (str: string): string => {\n return str.replace(/([-_][a-z])/gi, ($1) => {\n return $1.toUpperCase().replace('-', '').replace('_', '');\n });\n};\n\nexport const toSnakeCase = (str: string) =>\n str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n\ntype CaseConverter = (str: string) => string;\n\nconst convertCase = (\n caseConverter: CaseConverter,\n object: unknown,\n): unknown => {\n if (isObject(object)) {\n const newObject: Record<string, unknown> = {};\n\n Object.keys(object as Record<string, unknown>).forEach((key) => {\n newObject[caseConverter(key)] = convertCase(\n caseConverter,\n (object as Record<string, unknown>)[key],\n );\n });\n\n return newObject;\n } else if (Array.isArray(object)) {\n return object.map((arrayElement) =>\n convertCase(caseConverter, arrayElement),\n );\n }\n\n return object;\n};\n\nexport const convertSnakeCaseToCamelCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toCamelCase, object) as ReturnType;\n};\n\nexport const convertCamelCaseToSnakeCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toSnakeCase, object) as ReturnType;\n};\n", "import type { HttpErrorContext } from '@http-client-toolkit/core';\nimport { StatusCode } from './status-code.js';\nimport {\n ComicVineFilterError,\n ComicJsonpCallbackMissingError,\n ComicVineObjectNotFoundError,\n ComicVineSubscriberOnlyError,\n ComicVineUrlFormatError,\n ComicVineUnauthorizedError,\n ComicVineGenericRequestError,\n} from '../errors/index.js';\nimport { convertSnakeCaseToCamelCase } from '../utils/case-converter.js';\n\n/**\n * Transforms snake_case API responses to camelCase.\n * Plugs into the toolkit's `responseTransformer` hook.\n */\nexport function comicVineResponseTransformer(data: unknown): unknown {\n return convertSnakeCaseToCamelCase(data);\n}\n\n/**\n * Checks Comic Vine application-level status codes and throws domain errors.\n * Plugs into the toolkit's `responseHandler` hook.\n *\n * Comic Vine returns 200 OK for application-level errors with a `statusCode`\n * field in the response body that indicates the actual result.\n */\nexport function comicVineResponseHandler(data: unknown): unknown {\n if (\n data !== null &&\n typeof data === 'object' &&\n 'statusCode' in data &&\n typeof (data as Record<string, unknown>).statusCode === 'number'\n ) {\n const statusCode = (data as Record<string, unknown>).statusCode as number;\n switch (statusCode) {\n case StatusCode.FilterError:\n throw new ComicVineFilterError();\n case StatusCode.JsonpCallbackMissing:\n throw new ComicJsonpCallbackMissingError();\n case StatusCode.ObjectNotFound:\n throw new ComicVineObjectNotFoundError();\n case StatusCode.SubscriberOnlyVideo:\n throw new ComicVineSubscriberOnlyError();\n case StatusCode.UrlFormatError:\n throw new ComicVineUrlFormatError();\n }\n }\n return data;\n}\n\n/**\n * Maps HTTP errors to Comic Vine domain-specific errors.\n * Plugs into the toolkit's `errorHandler` hook.\n */\nexport function comicVineErrorHandler(context: HttpErrorContext): Error {\n if (context.response.status === 401) {\n return new ComicVineUnauthorizedError();\n }\n\n const bodyMessage =\n typeof context.response.data === 'object' && context.response.data !== null\n ? (context.response.data as { message?: string }).message\n : undefined;\n const message = bodyMessage\n ? `${context.message}, ${bodyMessage}`\n : context.message;\n return new ComicVineGenericRequestError(message);\n}\n", "import { ResourceType } from './resource-type.js';\nimport type {\n RetrieveOptions,\n ListOptions,\n HttpClient,\n UrlBuilder,\n PickFilters,\n} from '../types/index.js';\nimport type { Response } from '../types/response.js';\n\n// Common interface that all resources must implement\nexport interface ResourceInterface {\n retrieve(id: number, options?: Record<string, unknown>): Promise<unknown>;\n list(\n options?: Record<string, unknown>,\n ): Promise<unknown> & AsyncIterable<unknown>;\n}\n\nexport abstract class BaseResource<\n Resource,\n ResourceListItem,\n> implements ResourceInterface {\n protected abstract resourceType: ResourceType;\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n async retrieve<FieldKey extends keyof Resource>(\n id: number,\n options?: RetrieveOptions<FieldKey>,\n ) {\n type ReturnType<T> = T extends object ? Pick<Resource, FieldKey> : Resource;\n\n const url = this.urlBuilder.retrieve(this.resourceType, id, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<ResponseType>>(url, {\n priority: options?.priority,\n });\n\n return response.results;\n }\n\n private async fetchPage<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n type ReturnType<T> = T extends object\n ? Pick<ResourceListItem, FieldKey>\n : ResourceListItem;\n\n const url = this.urlBuilder.list(this.resourceType, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<Array<ResponseType>>>(\n url,\n {\n priority: options?.priority,\n },\n );\n\n return {\n limit: response.limit,\n numberOfPageResults: response.numberOfPageResults,\n numberOfTotalResults: response.numberOfTotalResults,\n offset: response.offset,\n data: response.results,\n };\n }\n\n list<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n // Proxy the call to this.fetchPage so that we can close over `this`, allowing access in the iterator\n const fetchPage = (opts?: Parameters<typeof this.fetchPage>[0]) =>\n this.fetchPage.call(this, opts);\n const fetchPagePromise = fetchPage(options);\n\n const asyncIterator = {\n async *[Symbol.asyncIterator]() {\n const defaultPageSize = 100;\n const limit = options?.limit ?? defaultPageSize;\n let page = options?.offset ? options.offset / limit + 1 : 1;\n let response = await fetchPagePromise;\n\n while (true) {\n for (const resource of response.data) {\n yield resource;\n }\n\n if (\n response.limit + response.offset >=\n response.numberOfTotalResults\n ) {\n break;\n }\n\n response = await fetchPage({\n limit,\n offset: response.numberOfPageResults * page++,\n });\n }\n },\n };\n\n const promiseWithAsyncIterator = Object.assign(\n fetchPagePromise,\n asyncIterator,\n );\n\n return promiseWithAsyncIterator;\n }\n}\n", "/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\nexport enum ResourceType {\n Character = 4005,\n Concept = 4015,\n Episode = 4070,\n Issue = 4000,\n Location = 4020,\n Movie = 4025,\n Origin = 4030,\n Person = 4040,\n Power = 4035,\n Promo = 1700,\n Publisher = 4010,\n Series = 4075,\n StoryArc = 4045,\n Team = 4060,\n Thing = 4055,\n Video = 2300,\n VideoCategory = 2320,\n VideoType = 2320,\n Volume = 4050,\n}\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { CharacterDetails, CharacterListItem } from './types/index.js';\n\nexport class Character extends BaseResource<\n CharacterDetails,\n CharacterListItem\n> {\n protected resourceType: ResourceType = ResourceType.Character;\n}\n", "export * from './character.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ConceptDetails, ConceptListItem } from './types/index.js';\n\nexport class Concept extends BaseResource<ConceptDetails, ConceptListItem> {\n protected resourceType: ResourceType = ResourceType.Concept;\n}\n", "export * from './concept.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { EpisodeDetails, EpisodeListItem } from './types/index.js';\n\nexport class Episode extends BaseResource<EpisodeDetails, EpisodeListItem> {\n protected resourceType: ResourceType = ResourceType.Episode;\n}\n", "export * from './episode.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { IssueDetails, IssueListItem } from './types/index.js';\n\nexport class Issue extends BaseResource<IssueDetails, IssueListItem> {\n protected resourceType: ResourceType = ResourceType.Issue;\n}\n", "export * from './issue.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { LocationDetails, LocationListItem } from './types/index.js';\n\nexport class Location extends BaseResource<LocationDetails, LocationListItem> {\n protected resourceType: ResourceType = ResourceType.Location;\n}\n", "export * from './location.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { MovieDetails, MovieListItem } from './types/index.js';\n\nexport class Movie extends BaseResource<MovieDetails, MovieListItem> {\n protected resourceType: ResourceType = ResourceType.Movie;\n}\n", "export * from './movie.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { OriginDetails, OriginListItem } from './types/index.js';\n\nexport class Origin extends BaseResource<OriginDetails, OriginListItem> {\n protected resourceType: ResourceType = ResourceType.Origin;\n}\n", "export * from './origin.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PersonDetails, PersonListItem } from './types/index.js';\n\nexport class Person extends BaseResource<PersonDetails, PersonListItem> {\n protected resourceType: ResourceType = ResourceType.Person;\n}\n", "export * from './person.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PowerDetails, PowerListItem } from './types/index.js';\n\nexport class Power extends BaseResource<PowerDetails, PowerListItem> {\n protected resourceType: ResourceType = ResourceType.Power;\n}\n", "export * from './power.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PromoDetails, PromoListItem } from './types/index.js';\n\nexport class Promo extends BaseResource<PromoDetails, PromoListItem> {\n protected resourceType: ResourceType = ResourceType.Promo;\n}\n", "export * from './promo.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PublisherDetails, PublisherListItem } from './types/index.js';\n\nexport class Publisher extends BaseResource<\n PublisherDetails,\n PublisherListItem\n> {\n protected resourceType: ResourceType = ResourceType.Publisher;\n}\n", "export * from './publisher.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { SeriesDetails, SeriesListItem } from './types/index.js';\n\nexport class Series extends BaseResource<SeriesDetails, SeriesListItem> {\n protected resourceType: ResourceType = ResourceType.Series;\n}\n", "export * from './series.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { StoryArcDetails, StoryArcListItem } from './types/index.js';\n\nexport class StoryArc extends BaseResource<StoryArcDetails, StoryArcListItem> {\n protected resourceType: ResourceType = ResourceType.StoryArc;\n}\n", "export * from './story-arc.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { TeamDetails, TeamListItem } from './types/index.js';\n\nexport class Team extends BaseResource<TeamDetails, TeamListItem> {\n protected resourceType: ResourceType = ResourceType.Team;\n}\n", "export * from './team.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ThingDetails, ThingListItem } from './types/index.js';\n\nexport class Thing extends BaseResource<ThingDetails, ThingListItem> {\n protected resourceType: ResourceType = ResourceType.Thing;\n}\n", "export * from './thing.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoDetails, VideoListItem } from './types/index.js';\n\nexport class Video extends BaseResource<VideoDetails, VideoListItem> {\n protected resourceType: ResourceType = ResourceType.Video;\n}\n", "export * from './video.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoCategoryDetails, VideoCategoryListItem } from './types/index.js';\n\nexport class VideoCategory extends BaseResource<\n VideoCategoryDetails,\n VideoCategoryListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoCategory;\n}\n", "export * from './video-category.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoTypeDetails, VideoTypeListItem } from './types/index.js';\n\nexport class VideoType extends BaseResource<\n VideoTypeDetails,\n VideoTypeListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoType;\n}\n", "export * from './video-type.js';\n", "import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VolumeDetails, VolumeListItem } from './types/index.js';\n\nexport class Volume extends BaseResource<VolumeDetails, VolumeListItem> {\n protected resourceType: ResourceType = ResourceType.Volume;\n}\n", "export * from './volume.js';\n", "export * from './character/index.js';\nexport * from './concept/index.js';\nexport * from './episode/index.js';\nexport * from './issue/index.js';\nexport * from './location/index.js';\nexport * from './movie/index.js';\nexport * from './origin/index.js';\nexport * from './person/index.js';\nexport * from './power/index.js';\nexport * from './promo/index.js';\nexport * from './publisher/index.js';\nexport * from './series/index.js';\nexport * from './story-arc/index.js';\nexport * from './team/index.js';\nexport * from './thing/index.js';\nexport * from './video/index.js';\nexport * from './video-category/index.js';\nexport * from './video-type/index.js';\nexport * from './volume/index.js';\n", "import * as resources from './resource-list.js';\nimport { HttpClient, UrlBuilder } from '../types/index.js';\n\nexport class ResourceFactory {\n private _resources = { ...resources };\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n public create<T extends keyof typeof this._resources>(\n name: T,\n ): InstanceType<(typeof this._resources)[T]>;\n public create(\n name: keyof typeof this._resources,\n ): InstanceType<(typeof this._resources)[keyof typeof this._resources]> {\n if (!this._resources[name]) {\n throw new Error(`${name} resource not implemented`);\n }\n const ResourceClass = this._resources[name] as new (\n httpClient: HttpClient,\n urlBuilder: UrlBuilder,\n ) => InstanceType<(typeof this._resources)[keyof typeof this._resources]>;\n return new ResourceClass(this.httpClient, this.urlBuilder);\n }\n}\n", "import { ResourceType } from './resource-type.js';\n\ninterface Resource {\n detailName: string;\n listName: string;\n}\n\nconst resourceMap = new Map<ResourceType, Resource>([\n [ResourceType.Character, { detailName: 'character', listName: 'characters' }],\n [ResourceType.Concept, { detailName: 'concept', listName: 'concepts' }],\n [ResourceType.Episode, { detailName: 'episode', listName: 'episodes' }],\n [ResourceType.Issue, { detailName: 'issue', listName: 'issues' }],\n [ResourceType.Location, { detailName: 'location', listName: 'locations' }],\n [ResourceType.Movie, { detailName: 'movie', listName: 'movies' }],\n [ResourceType.Origin, { detailName: 'origin', listName: 'origins' }],\n [ResourceType.Person, { detailName: 'person', listName: 'people' }],\n [ResourceType.Power, { detailName: 'power', listName: 'powers' }],\n [ResourceType.Promo, { detailName: 'promo', listName: 'promos' }],\n [ResourceType.Publisher, { detailName: 'publisher', listName: 'publishers' }],\n [ResourceType.Series, { detailName: 'series', listName: 'series_list' }],\n [ResourceType.StoryArc, { detailName: 'story_arc', listName: 'story_arcs' }],\n [ResourceType.Team, { detailName: 'team', listName: 'teams' }],\n [ResourceType.Thing, { detailName: 'object', listName: 'objects' }],\n [ResourceType.Video, { detailName: 'video', listName: 'videos' }],\n [\n ResourceType.VideoCategory,\n { detailName: 'video_category', listName: 'video_categories' },\n ],\n [\n ResourceType.VideoType,\n { detailName: 'video_type', listName: 'video_types' },\n ],\n [ResourceType.Volume, { detailName: 'volume', listName: 'volumes' }],\n]);\n\nexport const getResource = (resourceType: ResourceType) => {\n const resource = resourceMap.get(resourceType);\n if (!resource) {\n throw new Error(`Resource type (${resourceType}) not found`);\n }\n return resource;\n};\n", "export * from './resource-factory.js';\nexport * from './resource-map.js';\nexport * from './resource-type.js';\n", "export * from './case-converter.js';\nexport * from './is-object.js';\n", "import { getResource, ResourceType } from '../resources/index.js';\nimport { RetrieveOptions, ListOptions, Sort } from '../types/index.js';\nimport { toSnakeCase, convertCamelCaseToSnakeCase } from '../utils/index.js';\n\nconst isDefined = <T>(value: T): value is NonNullable<T> => {\n return value != null;\n};\n\ninterface QueryParam {\n name: string;\n value: string | number;\n}\n\nexport class UrlBuilder {\n constructor(\n private apiKey: string,\n private baseUrl: string,\n ) {}\n\n private getParam(key: string, value: string | number | undefined) {\n if (value) {\n return { name: toSnakeCase(key), value };\n }\n\n return undefined;\n }\n\n private getFormatParm() {\n return { name: 'format', value: `json` };\n }\n\n private getApiKeyParm() {\n return { name: 'api_key', value: this.apiKey };\n }\n\n private getSortParam(sort?: Sort) {\n if (sort) {\n return { name: 'sort', value: `${sort.field}:${sort.direction}` };\n }\n\n return undefined;\n }\n\n private getLimitParam(limit?: number) {\n if (limit) {\n return this.getParam('limit', limit);\n }\n\n return undefined;\n }\n\n private getOffsetParam(offset?: number) {\n if (offset) {\n return this.getParam('offset', offset);\n }\n\n return undefined;\n }\n\n private getFieldListParams<Key>(fieldList: Array<Key> | undefined) {\n if (fieldList) {\n return {\n name: 'field_list',\n value: fieldList.map((field) => toSnakeCase(String(field))).join(','),\n };\n }\n\n return undefined;\n }\n\n private getFilterParams<FilterType>(filter: FilterType | undefined) {\n if (filter) {\n const snakeCaseFilter =\n convertCamelCaseToSnakeCase<Record<string, unknown>>(filter);\n const filterParams = Object.entries<unknown>(snakeCaseFilter).map(\n ([key, value]) => `${key}:${value}`,\n );\n\n return { name: 'filter', value: filterParams.join(',') };\n }\n\n return undefined;\n }\n\n private buildUrl(\n urlInput: string,\n queryParams: Array<QueryParam | undefined>,\n ) {\n const url = new URL(urlInput, this.baseUrl);\n const urlSearchParams = new URLSearchParams(\n queryParams\n .filter(isDefined)\n .map<[string, string]>((param) => [param.name, param.value.toString()]),\n );\n\n url.search = urlSearchParams.toString();\n\n return url.toString();\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @param id A unique identifier for the resource\n * @returns A url for requesting the resource\n * @example https://comicvine.gamespot.com/api/issue/4000-719442?format=json&api_key=123abc\n */\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n options?: RetrieveOptions<Key>,\n ) {\n const resource = getResource(resourceType);\n const urlInput = `${resource.detailName}/${resourceType}-${id}`;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getFieldListParams(options?.fieldList),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @returns A url for requesting a list of resources\n * @example https://comicvine.gamespot.com/api/issues?format=json&api_key=123abc\n */\n list<Resource, FilterType>(\n resourceType: ResourceType,\n options?: ListOptions<Resource, FilterType>,\n ) {\n const urlInput = getResource(resourceType).listName;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getLimitParam(options?.limit),\n this.getOffsetParam(options?.offset),\n this.getSortParam(options?.sort),\n this.getFieldListParams(options?.fieldList),\n this.getFilterParams(options?.filter),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n}\n", "import { z, ZodError } from 'zod';\nimport { customError, OptionsValidationError } from '../errors/index.js';\n\nconst options = z.object({\n /**\n * The base url for the Comic Vine API.\n * This could be used to set a proxy when using the library in a browser.\n * It also ensures that if the comic vine url was to change it wouldn't be a breaking change to the library.\n * @default https://comicvine.gamespot.com/api/\n */\n baseUrl: z\n .string()\n .url()\n .optional()\n .default('https://comicvine.gamespot.com/api/'),\n});\n\nexport type userOptions = z.input<typeof options>;\nexport type Options = z.output<typeof options>;\n\nexport const loadOptions = (userOptions?: userOptions) => {\n try {\n return options.parse(userOptions ?? {});\n } catch (error: unknown) {\n if (error instanceof ZodError) {\n const validationError = error.issues[0];\n if (validationError) {\n throw new OptionsValidationError(\n validationError.path.filter(\n (segment): segment is string | number =>\n typeof segment === 'string' || typeof segment === 'number',\n ),\n validationError.message,\n );\n }\n throw new OptionsValidationError([], 'Unknown validation error');\n }\n throw customError(error);\n }\n};\n", "import {\n HttpClient,\n type CacheStore,\n type DedupeStore,\n type RateLimitStore,\n} from '@http-client-toolkit/core';\nimport {\n comicVineResponseTransformer,\n comicVineResponseHandler,\n comicVineErrorHandler,\n} from './http-client/hooks.js';\nimport { UrlBuilder } from './http-client/url-builder.js';\nimport { loadOptions } from './options/index.js';\nimport type { ResourceInterface } from './resources/base-resource.js';\nimport { ResourceFactory } from './resources/index.js';\nimport * as resources from './resources/resource-list.js';\nimport { getResource } from './resources/resource-map.js';\nimport { ResourceType } from './resources/resource-type.js';\nimport { toSnakeCase } from './utils/index.js';\n\nfunction classNameToPropertyName(className: string): string {\n if (!className) {\n return '';\n }\n return className.charAt(0).toLowerCase() + className.slice(1);\n}\n\ntype ResourceInstance = ReturnType<ResourceFactory['create']> &\n ResourceInterface;\n\n// Create resource property type mapping dynamically\ntype ResourcePropertyMap = {\n [K in keyof typeof resources as Uncapitalize<K>]: InstanceType<\n (typeof resources)[K]\n >;\n};\n\nconst resourceMappings = Object.values(ResourceType)\n .filter((value): value is ResourceType => typeof value === 'number')\n .map((resourceType) => getResource(resourceType));\n\nconst canonicalRateLimitResourceNames = new Map<string, string>();\nfor (const { detailName, listName } of resourceMappings) {\n canonicalRateLimitResourceNames.set(detailName, listName);\n canonicalRateLimitResourceNames.set(listName, listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(detailName), listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(listName), listName);\n}\n\nfunction normalizeRateLimitResourceName(resourceName: string): string {\n return (\n canonicalRateLimitResourceNames.get(toSnakeCase(resourceName)) ??\n resourceName\n );\n}\n\nfunction inferComicVineRateLimitResource(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n const segments = pathname.split('/').filter(Boolean);\n const apiIndex = segments.indexOf('api');\n const endpoint = apiIndex >= 0 ? segments[apiIndex + 1] : segments[0];\n\n if (!endpoint) {\n return 'unknown';\n }\n\n return normalizeRateLimitResourceName(endpoint);\n } catch {\n return 'unknown';\n }\n}\n\n/**\n * Consolidated options interface for ComicVine client\n */\nexport interface ComicVineOptions {\n /** Comic Vine API key */\n apiKey: string;\n\n /** Base URL for the Comic Vine API */\n baseUrl?: string;\n\n /** Store implementations for caching, deduplication, and rate limiting */\n stores?: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n /** HTTP client configuration */\n client?: {\n /** Default cache TTL in seconds */\n defaultCacheTTL?: number;\n /** Whether to throw errors on rate limit violations */\n throwOnRateLimit?: boolean;\n /** Maximum time to wait for rate limit in milliseconds */\n maxWaitTime?: number;\n };\n}\n\nexport class ComicVine implements ResourcePropertyMap {\n private resourceFactory: ResourceFactory;\n private resourceCache = new Map<string, ResourceInstance>();\n private resourceNames: Array<string>;\n private stores: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n // TypeScript property declarations for static typing (will be provided by Proxy)\n declare readonly character: ResourcePropertyMap['character'];\n declare readonly concept: ResourcePropertyMap['concept'];\n declare readonly episode: ResourcePropertyMap['episode'];\n declare readonly issue: ResourcePropertyMap['issue'];\n declare readonly location: ResourcePropertyMap['location'];\n declare readonly movie: ResourcePropertyMap['movie'];\n declare readonly origin: ResourcePropertyMap['origin'];\n declare readonly person: ResourcePropertyMap['person'];\n declare readonly power: ResourcePropertyMap['power'];\n declare readonly promo: ResourcePropertyMap['promo'];\n declare readonly publisher: ResourcePropertyMap['publisher'];\n declare readonly series: ResourcePropertyMap['series'];\n declare readonly storyArc: ResourcePropertyMap['storyArc'];\n declare readonly team: ResourcePropertyMap['team'];\n declare readonly thing: ResourcePropertyMap['thing'];\n declare readonly video: ResourcePropertyMap['video'];\n declare readonly videoCategory: ResourcePropertyMap['videoCategory'];\n declare readonly videoType: ResourcePropertyMap['videoType'];\n declare readonly volume: ResourcePropertyMap['volume'];\n\n /**\n * Create a new ComicVine client\n * @param options - Configuration options for the client\n */\n constructor(options: ComicVineOptions) {\n const { apiKey, baseUrl, stores = {}, client = {} } = options;\n\n const _options = loadOptions({ baseUrl });\n\n const httpClient = new HttpClient({\n name: 'comic-vine-sdk',\n cache: stores.cache\n ? {\n store: stores.cache,\n ttl: client.defaultCacheTTL,\n }\n : undefined,\n dedupe: stores.dedupe,\n rateLimit: stores.rateLimit\n ? {\n store: stores.rateLimit,\n throw: client.throwOnRateLimit,\n maxWaitTime: client.maxWaitTime,\n }\n : undefined,\n responseTransformer: comicVineResponseTransformer,\n responseHandler: comicVineResponseHandler,\n errorHandler: comicVineErrorHandler,\n resourceKeyResolver: inferComicVineRateLimitResource,\n });\n const urlBuilder = new UrlBuilder(apiKey, _options.baseUrl);\n\n this.resourceFactory = new ResourceFactory(httpClient, urlBuilder);\n this.stores = stores;\n\n // Discover available resources dynamically\n this.resourceNames = Object.keys(resources);\n\n // Return a proxy that provides lazy loading with full type safety\n return new Proxy(this, {\n get(target, prop: string | symbol) {\n if (typeof prop === 'string' && target.isResourceProperty(prop)) {\n return target.getResource(prop);\n }\n return Reflect.get(target, prop);\n },\n }) as ComicVine;\n }\n\n private isResourceProperty(prop: string): boolean {\n // Check if this property corresponds to a known resource\n const className = prop.charAt(0).toUpperCase() + prop.slice(1);\n return this.resourceNames.includes(className);\n }\n\n private getResource(propertyName: string): ResourceInstance {\n // Lazy loading: create resource only when first accessed\n if (!this.resourceCache.has(propertyName)) {\n const className =\n propertyName.charAt(0).toUpperCase() + propertyName.slice(1);\n try {\n const resource = this.resourceFactory.create(\n className as keyof typeof resources,\n );\n\n this.resourceCache.set(propertyName, resource);\n } catch (error) {\n throw new Error(`Failed to create resource '${className}': ${error}`, {\n cause: error,\n });\n }\n }\n return this.resourceCache.get(propertyName)!;\n }\n\n getAvailableResources(): Array<string> {\n return this.resourceNames.map((name) => classNameToPropertyName(name));\n }\n\n hasResource(resourceName: string): boolean {\n return this.isResourceProperty(resourceName);\n }\n\n getResourceByName(resourceName: string): ResourceInstance | undefined {\n if (!this.isResourceProperty(resourceName)) {\n return undefined;\n }\n return this.getResource(resourceName);\n }\n\n isResourceLoaded(resourceName: string): boolean {\n return this.resourceCache.has(resourceName);\n }\n\n getCacheStats(): {\n total: number;\n loaded: number;\n loadedResources: Array<string>;\n } {\n const total = this.resourceNames.length;\n const loaded = this.resourceCache.size;\n const loadedResources = Array.from(this.resourceCache.keys());\n return { total, loaded, loadedResources };\n }\n\n async clearCache(): Promise<void> {\n if (this.stores.cache) {\n await this.stores.cache.clear();\n }\n }\n\n async getRateLimitStatus(resourceName: string) {\n if (this.stores.rateLimit) {\n return this.stores.rateLimit.getStatus(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n return null;\n }\n\n async resetRateLimit(resourceName: string): Promise<void> {\n if (this.stores.rateLimit) {\n await this.stores.rateLimit.reset(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n }\n}\n", "export type { HttpClientContract as HttpClient } from '@http-client-toolkit/core';\n", "type digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;\ntype oneToNine = Exclude<digit, 0>;\n\ntype YYYY = `19${digit}${digit}` | `20${digit}${digit}`;\ntype MM = `0${oneToNine}` | `1${0 | 1 | 2}`;\ntype DD = `${0}${oneToNine}` | `${1 | 2}${digit}` | `3${0 | 1}`;\n\nexport type IsoDate = `${YYYY}-${MM}-${DD}`;\n", "type KeysMatching<T, V> = {\n [K in keyof T]-?: T[K] extends V ? K : never;\n}[keyof T];\n\ntype PickMatching<T, V> = Pick<T, KeysMatching<T, V>>;\n\nexport type PickFilters<T> = Partial<\n PickMatching<T, number> & PickMatching<T, string | null>\n>;\n", "import type { RequestPriority } from '@http-client-toolkit/core';\n\nexport interface BaseOptions<FieldKey> {\n /**\n * List of field names to include in the response.\n * Use this if you want to reduce the size of the response payload\n */\n fieldList?: Array<FieldKey>;\n}\n\nexport interface PriorityOptions {\n /**\n * Priority level for the request (affects rate limiting behavior)\n * - 'user': High priority, gets reserved capacity during activity\n * - 'background': Lower priority, may be throttled during high user activity\n */\n priority?: RequestPriority;\n}\n\nexport interface RetrieveOptions<FieldKey>\n extends BaseOptions<FieldKey>, PriorityOptions {}\n\nexport interface ListOptions<FieldKey, Filter>\n extends BaseOptions<FieldKey>, PriorityOptions {\n /**\n * The number of results to display per page\n * This value defaults to 100 and can not exceed this number\n */\n limit?: number;\n\n /**\n * Return results starting with the object at the offset specified\n */\n offset?: number;\n\n /**\n * The result set can be sorted by field in ascending or descending order\n */\n sort?: Sort;\n\n /**\n * The results can be filtered by field\n */\n filter?: Filter;\n}\n\nexport interface Sort {\n field: string;\n direction: 'asc' | 'desc';\n}\n", "import { StatusCode } from '../http-client/status-code.js';\n\nexport interface Response<Result> {\n // A text string representing the status_code\n error: 'OK';\n // The value of the limit filter specified, or 100 if not specified\n limit: number;\n // The value of the offset filter specified, or 0 if not specified\n offset: number;\n // The number of results on this page\n numberOfPageResults: number;\n // The number of total results matching the filter conditions specified\n numberOfTotalResults: number;\n // An integer indicating the result of the request\n statusCode: StatusCode;\n // Zero or more items that match the filters specified\n results: Result;\n}\n", "import { RetrieveOptions, ListOptions } from './index.js';\nimport { ResourceType } from '../resources/resource-type.js';\n\nexport interface UrlBuilder {\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n requestOptions?: RetrieveOptions<Key> | undefined,\n ): string;\n\n list<Resource, FilterType>(\n resourceType: ResourceType,\n requestOptions?: ListOptions<Resource, FilterType> | undefined,\n ): string;\n}\n", "export type ValueOf<T> = T[keyof T];\n", "export * from './http-client.js';\nexport * from './iso-date.js';\nexport * from './pick-filters.js';\nexport * from './request.js';\nexport * from './response.js';\nexport * from './url-builder.js';\nexport * from './valueof.js';\n", "import { ComicVine } from './comic-vine.js';\nimport { StatusCode } from './http-client/status-code.js';\n\nexport default ComicVine;\n\n// Named exports for better tree-shaking\nexport { ComicVine };\n\n// Export all error types\nexport * from './errors/index.js';\n\n// Export all types\nexport * from './types/index.js';\n\n// Export Comic Vine specific HTTP utilities\nexport { StatusCode };\n\n// Re-export client options\nexport type { ComicVineOptions } from './comic-vine.js';\n", "/* eslint-disable @typescript-eslint/no-require-imports */\nconst esm = require('./index');\n\nmodule.exports = Object.assign(esm.default, esm);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAY;AAAZ;AAAA;AAAA;AAAO,IAAK,aAAL,kBAAKA,gBAAL;AACL,MAAAA,wBAAA,QAAK,KAAL;AACA,MAAAA,wBAAA,mBAAgB,OAAhB;AACA,MAAAA,wBAAA,oBAAiB,OAAjB;AACA,MAAAA,wBAAA,oBAAiB,OAAjB;AACA,MAAAA,wBAAA,0BAAuB,OAAvB;AACA,MAAAA,wBAAA,iBAAc,OAAd;AACA,MAAAA,wBAAA,yBAAsB,OAAtB;AAPU,aAAAA;AAAA,OAAA;AAAA;AAAA;;;ACgBZ,SAAS,qBACP,kBACwC;AACxC,SACE,uBAAuB,oBACvB,OAAO,QAAQ,IAAI,kBAAkB,mBAAmB,MAAM;AAElE;AAvBA,iBAyBsB;AAzBtB;AAAA;AAAA;AAAA,kBAAgC;AAyBzB,IAAe,YAAf,cAAiC,4BAAgB;AAAA,MAGtD,YAAY,SAAuB;AAEjC,cAAM,QAAQ,OAAO;AACrB,aAAK,OAAO,KAAK,YAAY;AAG7B,YAAI,qBAAqB,KAAK,GAAG;AAC/B,gBAAM,kBAAkB,MAAM,UAAU;AAAA,QAC1C;AAGA,aAAK,OAAO,QAAQ;AAAA,MACtB;AAAA,IACF;AAAA;AAAA;;;ACzCA,IAEa;AAFb;AAAA;AAAA;AAAA;AAEO,IAAM,eAAN,cAA2B,UAAU;AAAA,MAC1C,YAAY,SAAkB;AAC5B,cAAM;AAAA,UACJ,SAAS,iCAAiC,WAAW,eAAe;AAAA,UACpE,MAAM;AAAA,QACR,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M,KAAK,OAAO,MAAM,MAAM;AAAA,UAChC;AAAA,QACF;AAAA;AAAA,MAEM,mBAAmB,cAAsB;AAAA;AAC7C,cAAI,KAAK,OAAO,WAAW;AACzB,mBAAO,KAAK,OAAO,UAAU;AAAA,cAC3B,+BAA+B,YAAY;AAAA,YAC7C;AAAA,UACF;AACA,iBAAO;AAAA,QACT;AAAA;AAAA,MAEM,eAAe,cAAqC;AAAA;AACxD,cAAI,KAAK,OAAO,WAAW;AACzB,kBAAM,KAAK,OAAO,UAAU;AAAA,cAC1B,+BAA+B,YAAY;AAAA,YAC7C;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF;AAAA;AAAA;;;ACnQA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,oBAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA,IAAAC;AACA;AAAA;AAAA;;;ACNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAGO;AAHP;AAAA;AAAA;AAAA;AACA;AAQA;AAGA;AATA,IAAO,gBAAQ;AAAA;AAAA;;;ACFf,IAAM,MAAM;AAEZ,OAAO,UAAU,OAAO,OAAO,IAAI,SAAS,GAAG;",
|
|
6
6
|
"names": ["StatusCode", "options", "_a", "ResourceType", "init_character", "init_concept", "init_episode", "init_issue", "init_location", "init_movie", "init_origin", "init_person", "init_power", "init_promo", "init_publisher", "init_series", "init_story_arc", "init_team", "init_thing", "init_video", "init_video_category", "init_video_type", "init_volume", "init_character", "init_concept", "init_episode", "init_issue", "init_location", "init_movie", "init_origin", "init_person", "init_power", "init_promo", "init_publisher", "init_series", "init_story_arc", "init_team", "init_thing", "init_video", "init_video_category", "init_video_type", "init_volume", "options", "import_core", "options", "init_url_builder", "init_url_builder"]
|
|
7
7
|
}
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __defProp = Object.defineProperty;
|
|
|
5
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
8
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
9
9
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
10
|
var __spreadValues = (a, b) => {
|
|
11
11
|
for (var prop in b || (b = {}))
|
|
@@ -54,7 +54,7 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
54
54
|
} catch (e) {
|
|
55
55
|
no(e);
|
|
56
56
|
}
|
|
57
|
-
}, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {};
|
|
57
|
+
}, method = (k, call, wait, clear) => it[k] = (x) => (call = new Promise((yes, no, run) => (run = () => resume(k, x, yes, no), q ? q.then(run) : run())), clear = () => q === wait && (q = 0), q = wait = call.then(clear, clear), call), q, it = {};
|
|
58
58
|
return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -69,12 +69,15 @@ var StatusCode = /* @__PURE__ */ ((StatusCode2) => {
|
|
|
69
69
|
StatusCode2[StatusCode2["SubscriberOnlyVideo"] = 105] = "SubscriberOnlyVideo";
|
|
70
70
|
return StatusCode2;
|
|
71
71
|
})(StatusCode || {});
|
|
72
|
+
function hasCaptureStackTrace(errorConstructor) {
|
|
73
|
+
return "captureStackTrace" in errorConstructor && typeof Reflect.get(errorConstructor, "captureStackTrace") === "function";
|
|
74
|
+
}
|
|
72
75
|
var BaseError = class extends HttpClientError {
|
|
73
76
|
constructor(details) {
|
|
74
77
|
super(details.message);
|
|
75
78
|
this.name = this.constructor.name;
|
|
76
|
-
if (Error
|
|
77
|
-
Error.captureStackTrace(this,
|
|
79
|
+
if (hasCaptureStackTrace(Error)) {
|
|
80
|
+
Error.captureStackTrace(this, new.target);
|
|
78
81
|
}
|
|
79
82
|
this.help = details.help;
|
|
80
83
|
}
|
|
@@ -317,20 +320,19 @@ var BaseResource = class {
|
|
|
317
320
|
const defaultPageSize = 100;
|
|
318
321
|
const limit = (_a2 = options2 == null ? void 0 : options2.limit) != null ? _a2 : defaultPageSize;
|
|
319
322
|
let page = (options2 == null ? void 0 : options2.offset) ? options2.offset / limit + 1 : 1;
|
|
320
|
-
let hasMoreResults = true;
|
|
321
323
|
let response = yield new __await(fetchPagePromise);
|
|
322
|
-
|
|
324
|
+
while (true) {
|
|
323
325
|
for (const resource of response.data) {
|
|
324
326
|
yield resource;
|
|
325
327
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
response = yield new __await(fetchPage({
|
|
329
|
-
limit,
|
|
330
|
-
offset: response.numberOfPageResults * page++
|
|
331
|
-
}));
|
|
328
|
+
if (response.limit + response.offset >= response.numberOfTotalResults) {
|
|
329
|
+
break;
|
|
332
330
|
}
|
|
333
|
-
|
|
331
|
+
response = yield new __await(fetchPage({
|
|
332
|
+
limit,
|
|
333
|
+
offset: response.numberOfPageResults * page++
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
334
336
|
});
|
|
335
337
|
}
|
|
336
338
|
};
|
|
@@ -688,7 +690,9 @@ var loadOptions = (userOptions) => {
|
|
|
688
690
|
const validationError = error.issues[0];
|
|
689
691
|
if (validationError) {
|
|
690
692
|
throw new OptionsValidationError(
|
|
691
|
-
validationError.path
|
|
693
|
+
validationError.path.filter(
|
|
694
|
+
(segment) => typeof segment === "string" || typeof segment === "number"
|
|
695
|
+
),
|
|
692
696
|
validationError.message
|
|
693
697
|
);
|
|
694
698
|
}
|
|
@@ -783,7 +787,9 @@ var ComicVine = class {
|
|
|
783
787
|
);
|
|
784
788
|
this.resourceCache.set(propertyName, resource);
|
|
785
789
|
} catch (error) {
|
|
786
|
-
throw new Error(`Failed to create resource '${className}': ${error}
|
|
790
|
+
throw new Error(`Failed to create resource '${className}': ${error}`, {
|
|
791
|
+
cause: error
|
|
792
|
+
});
|
|
787
793
|
}
|
|
788
794
|
}
|
|
789
795
|
return this.resourceCache.get(propertyName);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/http-client/status-code.ts","../src/errors/base-error.ts","../src/errors/generic-error.ts","../src/errors/custom-error.ts","../src/errors/filter-error.ts","../src/errors/generic-request-error.ts","../src/errors/jsonp-callback-missing-error.ts","../src/errors/object-not-found-error.ts","../src/errors/options-validation-error.ts","../src/errors/subscriber-only-error.ts","../src/errors/unauthorized-error.ts","../src/errors/url-format-error.ts","../src/utils/is-object.ts","../src/utils/case-converter.ts","../src/http-client/hooks.ts","../src/resources/resource-list.ts","../src/resources/base-resource.ts","../src/resources/resource-type.ts","../src/resources/character/character.ts","../src/resources/concept/concept.ts","../src/resources/episode/episode.ts","../src/resources/issue/issue.ts","../src/resources/location/location.ts","../src/resources/movie/movie.ts","../src/resources/origin/origin.ts","../src/resources/person/person.ts","../src/resources/power/power.ts","../src/resources/promo/promo.ts","../src/resources/publisher/publisher.ts","../src/resources/series/series.ts","../src/resources/story-arc/story-arc.ts","../src/resources/team/team.ts","../src/resources/thing/thing.ts","../src/resources/video/video.ts","../src/resources/video-category/video-category.ts","../src/resources/video-type/video-type.ts","../src/resources/volume/volume.ts","../src/resources/resource-factory.ts","../src/resources/resource-map.ts","../src/http-client/url-buil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AAA,EAC1C;AAAA,EAEM,UAAA,GAA4B;AAAA,IAAA,OAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AAChC,MAAA,IAAI,IAAA,CAAK,OAAO,KAAA,EAAO;AACrB,QAAA,MAAM,IAAA,CAAK,MAAA,CAAO,KAAA,CAAM,KAAA,EAAM;AAAA,MAChC;AAAA,IACF,CAAA,CAAA;AAAA,EAAA;AAAA,EAEM,mBAAmB,YAAA,EAAsB;AAAA,IAAA,OAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AAC7C,MAAA,IAAI,IAAA,CAAK,OAAO,SAAA,EAAW;AACzB,QAAA,OAAO,IAAA,CAAK,OAAO,SAAA,CAAU,SAAA;AAAA,UAC3B,+BAA+B,YAAY;AAAA,SAC7C;AAAA,MACF;AACA,MAAA,OAAO,IAAA;AAAA,IACT,CAAA,CAAA;AAAA,EAAA;AAAA,EAEM,eAAe,YAAA,EAAqC;AAAA,IAAA,OAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AACxD,MAAA,IAAI,IAAA,CAAK,OAAO,SAAA,EAAW;AACzB,QAAA,MAAM,IAAA,CAAK,OAAO,SAAA,CAAU,KAAA;AAAA,UAC1B,+BAA+B,YAAY;AAAA,SAC7C;AAAA,MACF;AAAA,IACF,CAAA,CAAA;AAAA,EAAA;AACF;;;AC9PA,IAAO,WAAA,GAAQ","file":"index.js","sourcesContent":["export enum StatusCode {\n OK = 1,\n InvalidApiKey = 100,\n ObjectNotFound = 101,\n UrlFormatError = 102,\n JsonpCallbackMissing = 103,\n FilterError = 104,\n SubscriberOnlyVideo = 105,\n}\n","import { HttpClientError } from '@http-client-toolkit/core';\n\ninterface ErrorDetails {\n message: string;\n help: string;\n}\n\nexport abstract class BaseError extends HttpClientError {\n public help: string;\n\n constructor(details: ErrorDetails) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(details.message);\n this.name = this.constructor.name;\n\n // Remove constructor invocation from the stack trace. Only available in V8.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n // Custom debugging information\n this.help = details.help;\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class GenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `An unexpected error occurred: ${message || 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { GenericError } from './generic-error.js';\n\nexport const customError = (error: unknown) => {\n if (error instanceof Error) {\n return new GenericError(error.message);\n }\n return new GenericError();\n};\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineFilterError extends BaseError {\n constructor() {\n super({\n message: 'There was a problem trying to filter the API results',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\n/**\n * @deprecated will be removed in the next major version, use ComicVineGenericRequestError instead!\n */\nexport class ComicVineGenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `Request to comic vine failed: ${message ?? 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n\nexport class ComicVineGenericRequestError extends ComicVineGenericError {\n constructor(message?: string) {\n super(message);\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicJsonpCallbackMissingError extends BaseError {\n constructor() {\n super({\n message: 'JSONP format requires a callback',\n help: 'This library does not use JSONP, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineObjectNotFoundError extends BaseError {\n constructor() {\n super({\n message:\n 'The requested resource could not be found in the Comic Vine API',\n help: 'Ensure you have used a valid resource Id',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class OptionsValidationError extends BaseError {\n constructor(path: Array<string | number>, message: string) {\n super({\n message: `Property: ${path.join('.')}, Problem: ${message}`,\n help: 'If the error message does not provide enough information or you believe there is a bug, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineSubscriberOnlyError extends BaseError {\n constructor() {\n super({\n message: 'The requested video is for subscribers only',\n help: 'Subscriber videos are part of a paid service, if you wish to upgrade you can do so here: https://comicvine.gamespot.com/upgrade/',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineUnauthorizedError extends BaseError {\n constructor() {\n super({\n message: 'Unauthorized response received when calling the Comic Vine API',\n help: 'Ensure you have a valid API key, you can get one from: https://comicvine.gamespot.com/api/',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineUrlFormatError extends BaseError {\n constructor() {\n super({\n message: 'The url for the request was not in the correct format',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","export const isObject = (maybeObject: unknown) =>\n maybeObject === Object(maybeObject) &&\n !Array.isArray(maybeObject) &&\n typeof maybeObject !== 'function';\n","import { isObject } from './is-object.js';\n\nexport const toCamelCase = (str: string): string => {\n return str.replace(/([-_][a-z])/gi, ($1) => {\n return $1.toUpperCase().replace('-', '').replace('_', '');\n });\n};\n\nexport const toSnakeCase = (str: string) =>\n str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n\ntype CaseConverter = (str: string) => string;\n\nconst convertCase = (\n caseConverter: CaseConverter,\n object: unknown,\n): unknown => {\n if (isObject(object)) {\n const newObject: Record<string, unknown> = {};\n\n Object.keys(object as Record<string, unknown>).forEach((key) => {\n newObject[caseConverter(key)] = convertCase(\n caseConverter,\n (object as Record<string, unknown>)[key],\n );\n });\n\n return newObject;\n } else if (Array.isArray(object)) {\n return object.map((arrayElement) =>\n convertCase(caseConverter, arrayElement),\n );\n }\n\n return object;\n};\n\nexport const convertSnakeCaseToCamelCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toCamelCase, object) as ReturnType;\n};\n\nexport const convertCamelCaseToSnakeCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toSnakeCase, object) as ReturnType;\n};\n","import type { HttpErrorContext } from '@http-client-toolkit/core';\nimport { StatusCode } from './status-code.js';\nimport {\n ComicVineFilterError,\n ComicJsonpCallbackMissingError,\n ComicVineObjectNotFoundError,\n ComicVineSubscriberOnlyError,\n ComicVineUrlFormatError,\n ComicVineUnauthorizedError,\n ComicVineGenericRequestError,\n} from '../errors/index.js';\nimport { convertSnakeCaseToCamelCase } from '../utils/case-converter.js';\n\n/**\n * Transforms snake_case API responses to camelCase.\n * Plugs into the toolkit's `responseTransformer` hook.\n */\nexport function comicVineResponseTransformer(data: unknown): unknown {\n return convertSnakeCaseToCamelCase(data);\n}\n\n/**\n * Checks Comic Vine application-level status codes and throws domain errors.\n * Plugs into the toolkit's `responseHandler` hook.\n *\n * Comic Vine returns 200 OK for application-level errors with a `statusCode`\n * field in the response body that indicates the actual result.\n */\nexport function comicVineResponseHandler(data: unknown): unknown {\n if (\n data !== null &&\n typeof data === 'object' &&\n 'statusCode' in data &&\n typeof (data as Record<string, unknown>).statusCode === 'number'\n ) {\n const statusCode = (data as Record<string, unknown>).statusCode as number;\n switch (statusCode) {\n case StatusCode.FilterError:\n throw new ComicVineFilterError();\n case StatusCode.JsonpCallbackMissing:\n throw new ComicJsonpCallbackMissingError();\n case StatusCode.ObjectNotFound:\n throw new ComicVineObjectNotFoundError();\n case StatusCode.SubscriberOnlyVideo:\n throw new ComicVineSubscriberOnlyError();\n case StatusCode.UrlFormatError:\n throw new ComicVineUrlFormatError();\n }\n }\n return data;\n}\n\n/**\n * Maps HTTP errors to Comic Vine domain-specific errors.\n * Plugs into the toolkit's `errorHandler` hook.\n */\nexport function comicVineErrorHandler(context: HttpErrorContext): Error {\n if (context.response.status === 401) {\n return new ComicVineUnauthorizedError();\n }\n\n const bodyMessage =\n typeof context.response.data === 'object' && context.response.data !== null\n ? (context.response.data as { message?: string }).message\n : undefined;\n const message = bodyMessage\n ? `${context.message}, ${bodyMessage}`\n : context.message;\n return new ComicVineGenericRequestError(message);\n}\n","export * from './character/index.js';\nexport * from './concept/index.js';\nexport * from './episode/index.js';\nexport * from './issue/index.js';\nexport * from './location/index.js';\nexport * from './movie/index.js';\nexport * from './origin/index.js';\nexport * from './person/index.js';\nexport * from './power/index.js';\nexport * from './promo/index.js';\nexport * from './publisher/index.js';\nexport * from './series/index.js';\nexport * from './story-arc/index.js';\nexport * from './team/index.js';\nexport * from './thing/index.js';\nexport * from './video/index.js';\nexport * from './video-category/index.js';\nexport * from './video-type/index.js';\nexport * from './volume/index.js';\n","import { ResourceType } from './resource-type.js';\nimport type {\n RetrieveOptions,\n ListOptions,\n HttpClient,\n UrlBuilder,\n PickFilters,\n} from '../types/index.js';\nimport type { Response } from '../types/response.js';\n\n// Common interface that all resources must implement\nexport interface ResourceInterface {\n retrieve(id: number, options?: Record<string, unknown>): Promise<unknown>;\n list(\n options?: Record<string, unknown>,\n ): Promise<unknown> & AsyncIterable<unknown>;\n}\n\nexport abstract class BaseResource<Resource, ResourceListItem>\n implements ResourceInterface\n{\n protected abstract resourceType: ResourceType;\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n async retrieve<FieldKey extends keyof Resource>(\n id: number,\n options?: RetrieveOptions<FieldKey>,\n ) {\n type ReturnType<T> = T extends object ? Pick<Resource, FieldKey> : Resource;\n\n const url = this.urlBuilder.retrieve(this.resourceType, id, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<ResponseType>>(url, {\n priority: options?.priority,\n });\n\n return response.results;\n }\n\n private async fetchPage<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n type ReturnType<T> = T extends object\n ? Pick<ResourceListItem, FieldKey>\n : ResourceListItem;\n\n const url = this.urlBuilder.list(this.resourceType, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<Array<ResponseType>>>(\n url,\n {\n priority: options?.priority,\n },\n );\n\n return {\n limit: response.limit,\n numberOfPageResults: response.numberOfPageResults,\n numberOfTotalResults: response.numberOfTotalResults,\n offset: response.offset,\n data: response.results,\n };\n }\n\n list<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n // Proxy the call to this.fetchPage so that we can close over `this`, allowing access in the iterator\n const fetchPage = (opts?: Parameters<typeof this.fetchPage>[0]) =>\n this.fetchPage.call(this, opts);\n const fetchPagePromise = fetchPage(options);\n\n const asyncIterator = {\n async *[Symbol.asyncIterator]() {\n const defaultPageSize = 100;\n const limit = options?.limit ?? defaultPageSize;\n let page = options?.offset ? options.offset / limit + 1 : 1;\n let hasMoreResults = true;\n let response = await fetchPagePromise;\n\n do {\n for (const resource of response.data) {\n yield resource;\n }\n\n hasMoreResults =\n response.limit + response.offset < response.numberOfTotalResults;\n\n if (hasMoreResults) {\n response = await fetchPage({\n limit,\n offset: response.numberOfPageResults * page++,\n });\n }\n } while (hasMoreResults);\n },\n };\n\n const promiseWithAsyncIterator = Object.assign(\n fetchPagePromise,\n asyncIterator,\n );\n\n return promiseWithAsyncIterator;\n }\n}\n","/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\nexport enum ResourceType {\n Character = 4005,\n Concept = 4015,\n Episode = 4070,\n Issue = 4000,\n Location = 4020,\n Movie = 4025,\n Origin = 4030,\n Person = 4040,\n Power = 4035,\n Promo = 1700,\n Publisher = 4010,\n Series = 4075,\n StoryArc = 4045,\n Team = 4060,\n Thing = 4055,\n Video = 2300,\n VideoCategory = 2320,\n VideoType = 2320,\n Volume = 4050,\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { CharacterDetails, CharacterListItem } from './types/index.js';\n\nexport class Character extends BaseResource<\n CharacterDetails,\n CharacterListItem\n> {\n protected resourceType: ResourceType = ResourceType.Character;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ConceptDetails, ConceptListItem } from './types/index.js';\n\nexport class Concept extends BaseResource<ConceptDetails, ConceptListItem> {\n protected resourceType: ResourceType = ResourceType.Concept;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { EpisodeDetails, EpisodeListItem } from './types/index.js';\n\nexport class Episode extends BaseResource<EpisodeDetails, EpisodeListItem> {\n protected resourceType: ResourceType = ResourceType.Episode;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { IssueDetails, IssueListItem } from './types/index.js';\n\nexport class Issue extends BaseResource<IssueDetails, IssueListItem> {\n protected resourceType: ResourceType = ResourceType.Issue;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { LocationDetails, LocationListItem } from './types/index.js';\n\nexport class Location extends BaseResource<LocationDetails, LocationListItem> {\n protected resourceType: ResourceType = ResourceType.Location;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { MovieDetails, MovieListItem } from './types/index.js';\n\nexport class Movie extends BaseResource<MovieDetails, MovieListItem> {\n protected resourceType: ResourceType = ResourceType.Movie;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { OriginDetails, OriginListItem } from './types/index.js';\n\nexport class Origin extends BaseResource<OriginDetails, OriginListItem> {\n protected resourceType: ResourceType = ResourceType.Origin;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PersonDetails, PersonListItem } from './types/index.js';\n\nexport class Person extends BaseResource<PersonDetails, PersonListItem> {\n protected resourceType: ResourceType = ResourceType.Person;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PowerDetails, PowerListItem } from './types/index.js';\n\nexport class Power extends BaseResource<PowerDetails, PowerListItem> {\n protected resourceType: ResourceType = ResourceType.Power;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PromoDetails, PromoListItem } from './types/index.js';\n\nexport class Promo extends BaseResource<PromoDetails, PromoListItem> {\n protected resourceType: ResourceType = ResourceType.Promo;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PublisherDetails, PublisherListItem } from './types/index.js';\n\nexport class Publisher extends BaseResource<\n PublisherDetails,\n PublisherListItem\n> {\n protected resourceType: ResourceType = ResourceType.Publisher;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { SeriesDetails, SeriesListItem } from './types/index.js';\n\nexport class Series extends BaseResource<SeriesDetails, SeriesListItem> {\n protected resourceType: ResourceType = ResourceType.Series;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { StoryArcDetails, StoryArcListItem } from './types/index.js';\n\nexport class StoryArc extends BaseResource<StoryArcDetails, StoryArcListItem> {\n protected resourceType: ResourceType = ResourceType.StoryArc;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { TeamDetails, TeamListItem } from './types/index.js';\n\nexport class Team extends BaseResource<TeamDetails, TeamListItem> {\n protected resourceType: ResourceType = ResourceType.Team;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ThingDetails, ThingListItem } from './types/index.js';\n\nexport class Thing extends BaseResource<ThingDetails, ThingListItem> {\n protected resourceType: ResourceType = ResourceType.Thing;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoDetails, VideoListItem } from './types/index.js';\n\nexport class Video extends BaseResource<VideoDetails, VideoListItem> {\n protected resourceType: ResourceType = ResourceType.Video;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoCategoryDetails, VideoCategoryListItem } from './types/index.js';\n\nexport class VideoCategory extends BaseResource<\n VideoCategoryDetails,\n VideoCategoryListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoCategory;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoTypeDetails, VideoTypeListItem } from './types/index.js';\n\nexport class VideoType extends BaseResource<\n VideoTypeDetails,\n VideoTypeListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoType;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VolumeDetails, VolumeListItem } from './types/index.js';\n\nexport class Volume extends BaseResource<VolumeDetails, VolumeListItem> {\n protected resourceType: ResourceType = ResourceType.Volume;\n}\n","import * as resources from './resource-list.js';\nimport { HttpClient, UrlBuilder } from '../types/index.js';\n\nexport class ResourceFactory {\n private _resources = { ...resources };\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n public create<T extends keyof typeof this._resources>(\n name: T,\n ): InstanceType<(typeof this._resources)[T]>;\n public create(\n name: keyof typeof this._resources,\n ): InstanceType<(typeof this._resources)[keyof typeof this._resources]> {\n if (!this._resources[name]) {\n throw new Error(`${name} resource not implemented`);\n }\n const ResourceClass = this._resources[name] as new (\n httpClient: HttpClient,\n urlBuilder: UrlBuilder,\n ) => InstanceType<(typeof this._resources)[keyof typeof this._resources]>;\n return new ResourceClass(this.httpClient, this.urlBuilder);\n }\n}\n","import { ResourceType } from './resource-type.js';\n\ninterface Resource {\n detailName: string;\n listName: string;\n}\n\nconst resourceMap = new Map<ResourceType, Resource>([\n [ResourceType.Character, { detailName: 'character', listName: 'characters' }],\n [ResourceType.Concept, { detailName: 'concept', listName: 'concepts' }],\n [ResourceType.Episode, { detailName: 'episode', listName: 'episodes' }],\n [ResourceType.Issue, { detailName: 'issue', listName: 'issues' }],\n [ResourceType.Location, { detailName: 'location', listName: 'locations' }],\n [ResourceType.Movie, { detailName: 'movie', listName: 'movies' }],\n [ResourceType.Origin, { detailName: 'origin', listName: 'origins' }],\n [ResourceType.Person, { detailName: 'person', listName: 'people' }],\n [ResourceType.Power, { detailName: 'power', listName: 'powers' }],\n [ResourceType.Promo, { detailName: 'promo', listName: 'promos' }],\n [ResourceType.Publisher, { detailName: 'publisher', listName: 'publishers' }],\n [ResourceType.Series, { detailName: 'series', listName: 'series_list' }],\n [ResourceType.StoryArc, { detailName: 'story_arc', listName: 'story_arcs' }],\n [ResourceType.Team, { detailName: 'team', listName: 'teams' }],\n [ResourceType.Thing, { detailName: 'object', listName: 'objects' }],\n [ResourceType.Video, { detailName: 'video', listName: 'videos' }],\n [\n ResourceType.VideoCategory,\n { detailName: 'video_category', listName: 'video_categories' },\n ],\n [\n ResourceType.VideoType,\n { detailName: 'video_type', listName: 'video_types' },\n ],\n [ResourceType.Volume, { detailName: 'volume', listName: 'volumes' }],\n]);\n\nexport const getResource = (resourceType: ResourceType) => {\n const resource = resourceMap.get(resourceType);\n if (!resource) {\n throw new Error(`Resource type (${resourceType}) not found`);\n }\n return resource;\n};\n","import { getResource, ResourceType } from '../resources/index.js';\nimport { RetrieveOptions, ListOptions, Sort } from '../types/index.js';\nimport { toSnakeCase, convertCamelCaseToSnakeCase } from '../utils/index.js';\n\nconst isDefined = <T>(value: T): value is NonNullable<T> => {\n return value != null;\n};\n\ninterface QueryParam {\n name: string;\n value: string | number;\n}\n\nexport class UrlBuilder {\n constructor(\n private apiKey: string,\n private baseUrl: string,\n ) {}\n\n private getParam(key: string, value: string | number | undefined) {\n if (value) {\n return { name: toSnakeCase(key), value };\n }\n\n return undefined;\n }\n\n private getFormatParm() {\n return { name: 'format', value: `json` };\n }\n\n private getApiKeyParm() {\n return { name: 'api_key', value: this.apiKey };\n }\n\n private getSortParam(sort?: Sort) {\n if (sort) {\n return { name: 'sort', value: `${sort.field}:${sort.direction}` };\n }\n\n return undefined;\n }\n\n private getLimitParam(limit?: number) {\n if (limit) {\n return this.getParam('limit', limit);\n }\n\n return undefined;\n }\n\n private getOffsetParam(offset?: number) {\n if (offset) {\n return this.getParam('offset', offset);\n }\n\n return undefined;\n }\n\n private getFieldListParams<Key>(fieldList: Array<Key> | undefined) {\n if (fieldList) {\n return {\n name: 'field_list',\n value: fieldList.map((field) => toSnakeCase(String(field))).join(','),\n };\n }\n\n return undefined;\n }\n\n private getFilterParams<FilterType>(filter: FilterType | undefined) {\n if (filter) {\n const snakeCaseFilter =\n convertCamelCaseToSnakeCase<Record<string, unknown>>(filter);\n const filterParams = Object.entries<unknown>(snakeCaseFilter).map(\n ([key, value]) => `${key}:${value}`,\n );\n\n return { name: 'filter', value: filterParams.join(',') };\n }\n\n return undefined;\n }\n\n private buildUrl(\n urlInput: string,\n queryParams: Array<QueryParam | undefined>,\n ) {\n const url = new URL(urlInput, this.baseUrl);\n const urlSearchParams = new URLSearchParams(\n queryParams\n .filter(isDefined)\n .map<[string, string]>((param) => [param.name, param.value.toString()]),\n );\n\n url.search = urlSearchParams.toString();\n\n return url.toString();\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @param id A unique identifier for the resource\n * @returns A url for requesting the resource\n * @example https://comicvine.gamespot.com/api/issue/4000-719442?format=json&api_key=123abc\n */\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n options?: RetrieveOptions<Key>,\n ) {\n const resource = getResource(resourceType);\n const urlInput = `${resource.detailName}/${resourceType}-${id}`;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getFieldListParams(options?.fieldList),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @returns A url for requesting a list of resources\n * @example https://comicvine.gamespot.com/api/issues?format=json&api_key=123abc\n */\n list<Resource, FilterType>(\n resourceType: ResourceType,\n options?: ListOptions<Resource, FilterType>,\n ) {\n const urlInput = getResource(resourceType).listName;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getLimitParam(options?.limit),\n this.getOffsetParam(options?.offset),\n this.getSortParam(options?.sort),\n this.getFieldListParams(options?.fieldList),\n this.getFilterParams(options?.filter),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n}\n","import { z, ZodError } from 'zod';\nimport { customError, OptionsValidationError } from '../errors/index.js';\n\nconst options = z.object({\n /**\n * The base url for the Comic Vine API.\n * This could be used to set a proxy when using the library in a browser.\n * It also ensures that if the comic vine url was to change it wouldn't be a breaking change to the library.\n * @default https://comicvine.gamespot.com/api/\n */\n baseUrl: z\n .string()\n .url()\n .optional()\n .default('https://comicvine.gamespot.com/api/'),\n});\n\nexport type userOptions = z.input<typeof options>;\nexport type Options = z.output<typeof options>;\n\nexport const loadOptions = (userOptions?: userOptions) => {\n try {\n return options.parse(userOptions ?? {});\n } catch (error: unknown) {\n if (error instanceof ZodError) {\n const validationError = error.issues[0];\n if (validationError) {\n throw new OptionsValidationError(\n validationError.path,\n validationError.message,\n );\n }\n throw new OptionsValidationError([], 'Unknown validation error');\n }\n throw customError(error);\n }\n};\n","import {\n HttpClient,\n type CacheStore,\n type DedupeStore,\n type RateLimitStore,\n} from '@http-client-toolkit/core';\nimport {\n comicVineResponseTransformer,\n comicVineResponseHandler,\n comicVineErrorHandler,\n} from './http-client/hooks.js';\nimport { UrlBuilder } from './http-client/url-builder.js';\nimport { loadOptions } from './options/index.js';\nimport type { ResourceInterface } from './resources/base-resource.js';\nimport { ResourceFactory } from './resources/index.js';\nimport * as resources from './resources/resource-list.js';\nimport { getResource } from './resources/resource-map.js';\nimport { ResourceType } from './resources/resource-type.js';\nimport { toSnakeCase } from './utils/index.js';\n\nfunction classNameToPropertyName(className: string): string {\n if (!className) {\n return '';\n }\n return className.charAt(0).toLowerCase() + className.slice(1);\n}\n\ntype ResourceInstance = ReturnType<ResourceFactory['create']> &\n ResourceInterface;\n\n// Create resource property type mapping dynamically\ntype ResourcePropertyMap = {\n [K in keyof typeof resources as Uncapitalize<K>]: InstanceType<\n (typeof resources)[K]\n >;\n};\n\nconst resourceMappings = Object.values(ResourceType)\n .filter((value): value is ResourceType => typeof value === 'number')\n .map((resourceType) => getResource(resourceType));\n\nconst canonicalRateLimitResourceNames = new Map<string, string>();\nfor (const { detailName, listName } of resourceMappings) {\n canonicalRateLimitResourceNames.set(detailName, listName);\n canonicalRateLimitResourceNames.set(listName, listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(detailName), listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(listName), listName);\n}\n\nfunction normalizeRateLimitResourceName(resourceName: string): string {\n return (\n canonicalRateLimitResourceNames.get(toSnakeCase(resourceName)) ??\n resourceName\n );\n}\n\nfunction inferComicVineRateLimitResource(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n const segments = pathname.split('/').filter(Boolean);\n const apiIndex = segments.indexOf('api');\n const endpoint = apiIndex >= 0 ? segments[apiIndex + 1] : segments[0];\n\n if (!endpoint) {\n return 'unknown';\n }\n\n return normalizeRateLimitResourceName(endpoint);\n } catch {\n return 'unknown';\n }\n}\n\n/**\n * Consolidated options interface for ComicVine client\n */\nexport interface ComicVineOptions {\n /** Comic Vine API key */\n apiKey: string;\n\n /** Base URL for the Comic Vine API */\n baseUrl?: string;\n\n /** Store implementations for caching, deduplication, and rate limiting */\n stores?: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n /** HTTP client configuration */\n client?: {\n /** Default cache TTL in seconds */\n defaultCacheTTL?: number;\n /** Whether to throw errors on rate limit violations */\n throwOnRateLimit?: boolean;\n /** Maximum time to wait for rate limit in milliseconds */\n maxWaitTime?: number;\n };\n}\n\nexport class ComicVine implements ResourcePropertyMap {\n private resourceFactory: ResourceFactory;\n private resourceCache = new Map<string, ResourceInstance>();\n private resourceNames: Array<string>;\n private stores: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n // TypeScript property declarations for static typing (will be provided by Proxy)\n declare readonly character: ResourcePropertyMap['character'];\n declare readonly concept: ResourcePropertyMap['concept'];\n declare readonly episode: ResourcePropertyMap['episode'];\n declare readonly issue: ResourcePropertyMap['issue'];\n declare readonly location: ResourcePropertyMap['location'];\n declare readonly movie: ResourcePropertyMap['movie'];\n declare readonly origin: ResourcePropertyMap['origin'];\n declare readonly person: ResourcePropertyMap['person'];\n declare readonly power: ResourcePropertyMap['power'];\n declare readonly promo: ResourcePropertyMap['promo'];\n declare readonly publisher: ResourcePropertyMap['publisher'];\n declare readonly series: ResourcePropertyMap['series'];\n declare readonly storyArc: ResourcePropertyMap['storyArc'];\n declare readonly team: ResourcePropertyMap['team'];\n declare readonly thing: ResourcePropertyMap['thing'];\n declare readonly video: ResourcePropertyMap['video'];\n declare readonly videoCategory: ResourcePropertyMap['videoCategory'];\n declare readonly videoType: ResourcePropertyMap['videoType'];\n declare readonly volume: ResourcePropertyMap['volume'];\n\n /**\n * Create a new ComicVine client\n * @param options - Configuration options for the client\n */\n constructor(options: ComicVineOptions) {\n const { apiKey, baseUrl, stores = {}, client = {} } = options;\n\n const _options = loadOptions({ baseUrl });\n\n const httpClient = new HttpClient({\n name: 'comic-vine-sdk',\n cache: stores.cache\n ? {\n store: stores.cache,\n ttl: client.defaultCacheTTL,\n }\n : undefined,\n dedupe: stores.dedupe,\n rateLimit: stores.rateLimit\n ? {\n store: stores.rateLimit,\n throw: client.throwOnRateLimit,\n maxWaitTime: client.maxWaitTime,\n }\n : undefined,\n responseTransformer: comicVineResponseTransformer,\n responseHandler: comicVineResponseHandler,\n errorHandler: comicVineErrorHandler,\n resourceKeyResolver: inferComicVineRateLimitResource,\n });\n const urlBuilder = new UrlBuilder(apiKey, _options.baseUrl);\n\n this.resourceFactory = new ResourceFactory(httpClient, urlBuilder);\n this.stores = stores;\n\n // Discover available resources dynamically\n this.resourceNames = Object.keys(resources);\n\n // Return a proxy that provides lazy loading with full type safety\n return new Proxy(this, {\n get(target, prop: string | symbol) {\n if (typeof prop === 'string' && target.isResourceProperty(prop)) {\n return target.getResource(prop);\n }\n return Reflect.get(target, prop);\n },\n }) as ComicVine;\n }\n\n private isResourceProperty(prop: string): boolean {\n // Check if this property corresponds to a known resource\n const className = prop.charAt(0).toUpperCase() + prop.slice(1);\n return this.resourceNames.includes(className);\n }\n\n private getResource(propertyName: string): ResourceInstance {\n // Lazy loading: create resource only when first accessed\n if (!this.resourceCache.has(propertyName)) {\n const className =\n propertyName.charAt(0).toUpperCase() + propertyName.slice(1);\n try {\n const resource = this.resourceFactory.create(\n className as keyof typeof resources,\n );\n\n this.resourceCache.set(propertyName, resource);\n } catch (error) {\n throw new Error(`Failed to create resource '${className}': ${error}`);\n }\n }\n return this.resourceCache.get(propertyName)!;\n }\n\n getAvailableResources(): Array<string> {\n return this.resourceNames.map((name) => classNameToPropertyName(name));\n }\n\n hasResource(resourceName: string): boolean {\n return this.isResourceProperty(resourceName);\n }\n\n getResourceByName(resourceName: string): ResourceInstance | undefined {\n if (!this.isResourceProperty(resourceName)) {\n return undefined;\n }\n return this.getResource(resourceName);\n }\n\n isResourceLoaded(resourceName: string): boolean {\n return this.resourceCache.has(resourceName);\n }\n\n getCacheStats(): {\n total: number;\n loaded: number;\n loadedResources: Array<string>;\n } {\n const total = this.resourceNames.length;\n const loaded = this.resourceCache.size;\n const loadedResources = Array.from(this.resourceCache.keys());\n return { total, loaded, loadedResources };\n }\n\n async clearCache(): Promise<void> {\n if (this.stores.cache) {\n await this.stores.cache.clear();\n }\n }\n\n async getRateLimitStatus(resourceName: string) {\n if (this.stores.rateLimit) {\n return this.stores.rateLimit.getStatus(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n return null;\n }\n\n async resetRateLimit(resourceName: string): Promise<void> {\n if (this.stores.rateLimit) {\n await this.stores.rateLimit.reset(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n }\n}\n","import { ComicVine } from './comic-vine.js';\nimport { StatusCode } from './http-client/status-code.js';\n\nexport default ComicVine;\n\n// Named exports for better tree-shaking\nexport { ComicVine };\n\n// Export all error types\nexport * from './errors/index.js';\n\n// Export all types\nexport * from './types/index.js';\n\n// Export Comic Vine specific HTTP utilities\nexport { StatusCode };\n\n// Re-export client options\nexport type { ComicVineOptions } from './comic-vine.js';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/http-client/status-code.ts","../src/errors/base-error.ts","../src/errors/generic-error.ts","../src/errors/custom-error.ts","../src/errors/filter-error.ts","../src/errors/generic-request-error.ts","../src/errors/jsonp-callback-missing-error.ts","../src/errors/object-not-found-error.ts","../src/errors/options-validation-error.ts","../src/errors/subscriber-only-error.ts","../src/errors/unauthorized-error.ts","../src/errors/url-format-error.ts","../src/utils/is-object.ts","../src/utils/case-converter.ts","../src/http-client/hooks.ts","../src/resources/resource-list.ts","../src/resources/base-resource.ts","../src/resources/resource-type.ts","../src/resources/character/character.ts","../src/resources/concept/concept.ts","../src/resources/episode/episode.ts","../src/resources/issue/issue.ts","../src/resources/location/location.ts","../src/resources/movie/movie.ts","../src/resources/origin/origin.ts","../src/resources/person/person.ts","../src/resources/power/power.ts","../src/resources/promo/promo.ts","../src/resources/publisher/publisher.ts","../src/resources/series/series.ts","../src/resources/story-arc/story-arc.ts","../src/resources/team/team.ts","../src/resources/thing/thing.ts","../src/resources/video/video.ts","../src/resources/video-category/video-category.ts","../src/resources/video-type/video-type.ts","../src/resources/volume/volume.ts","../src/resources/resource-factory.ts","../src/resources/resource-map.ts","../src/http-client/url-builder.ts","../src/options/index.ts","../src/comic-vine.ts","../src/index.ts"],"names":["StatusCode","options","_a","ResourceType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAK,UAAA,qBAAAA,WAAAA,KAAL;AACL,EAAAA,WAAAA,CAAAA,WAAAA,CAAA,QAAK,CAAA,CAAA,GAAL,IAAA;AACA,EAAAA,WAAAA,CAAAA,WAAAA,CAAA,mBAAgB,GAAA,CAAA,GAAhB,eAAA;AACA,EAAAA,WAAAA,CAAAA,WAAAA,CA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AAA,MAAM,IAAA,CAAK,MAAA,CAAO,KAAA,CAAM,KAAA,EAAM;AAAA,MAChC;AAAA,IACF,CAAA,CAAA;AAAA,EAAA;AAAA,EAEM,mBAAmB,YAAA,EAAsB;AAAA,IAAA,OAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AAC7C,MAAA,IAAI,IAAA,CAAK,OAAO,SAAA,EAAW;AACzB,QAAA,OAAO,IAAA,CAAK,OAAO,SAAA,CAAU,SAAA;AAAA,UAC3B,+BAA+B,YAAY;AAAA,SAC7C;AAAA,MACF;AACA,MAAA,OAAO,IAAA;AAAA,IACT,CAAA,CAAA;AAAA,EAAA;AAAA,EAEM,eAAe,YAAA,EAAqC;AAAA,IAAA,OAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AACxD,MAAA,IAAI,IAAA,CAAK,OAAO,SAAA,EAAW;AACzB,QAAA,MAAM,IAAA,CAAK,OAAO,SAAA,CAAU,KAAA;AAAA,UAC1B,+BAA+B,YAAY;AAAA,SAC7C;AAAA,MACF;AAAA,IACF,CAAA,CAAA;AAAA,EAAA;AACF;;;AChQA,IAAO,WAAA,GAAQ","file":"index.js","sourcesContent":["export enum StatusCode {\n OK = 1,\n InvalidApiKey = 100,\n ObjectNotFound = 101,\n UrlFormatError = 102,\n JsonpCallbackMissing = 103,\n FilterError = 104,\n SubscriberOnlyVideo = 105,\n}\n","import { HttpClientError } from '@http-client-toolkit/core';\n\ninterface ErrorDetails {\n message: string;\n help: string;\n}\n\ntype CaptureStackTrace = (\n targetObject: object,\n constructorOpt?: abstract new (...args: Array<never>) => object,\n) => void;\n\ninterface V8ErrorConstructor extends ErrorConstructor {\n captureStackTrace: CaptureStackTrace;\n}\n\nfunction hasCaptureStackTrace(\n errorConstructor: ErrorConstructor,\n): errorConstructor is V8ErrorConstructor {\n return (\n 'captureStackTrace' in errorConstructor &&\n typeof Reflect.get(errorConstructor, 'captureStackTrace') === 'function'\n );\n}\n\nexport abstract class BaseError extends HttpClientError {\n public help: string;\n\n constructor(details: ErrorDetails) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(details.message);\n this.name = this.constructor.name;\n\n // Remove constructor invocation from the stack trace. Only available in V8.\n if (hasCaptureStackTrace(Error)) {\n Error.captureStackTrace(this, new.target);\n }\n\n // Custom debugging information\n this.help = details.help;\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class GenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `An unexpected error occurred: ${message || 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { GenericError } from './generic-error.js';\n\nexport const customError = (error: unknown) => {\n if (error instanceof Error) {\n return new GenericError(error.message);\n }\n return new GenericError();\n};\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineFilterError extends BaseError {\n constructor() {\n super({\n message: 'There was a problem trying to filter the API results',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\n/**\n * @deprecated will be removed in the next major version, use ComicVineGenericRequestError instead!\n */\nexport class ComicVineGenericError extends BaseError {\n constructor(message?: string) {\n super({\n message: `Request to comic vine failed: ${message ?? 'Unknown Error'}`,\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n\nexport class ComicVineGenericRequestError extends ComicVineGenericError {\n constructor(message?: string) {\n super(message);\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicJsonpCallbackMissingError extends BaseError {\n constructor() {\n super({\n message: 'JSONP format requires a callback',\n help: 'This library does not use JSONP, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineObjectNotFoundError extends BaseError {\n constructor() {\n super({\n message:\n 'The requested resource could not be found in the Comic Vine API',\n help: 'Ensure you have used a valid resource Id',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class OptionsValidationError extends BaseError {\n constructor(path: Array<string | number>, message: string) {\n super({\n message: `Property: ${path.join('.')}, Problem: ${message}`,\n help: 'If the error message does not provide enough information or you believe there is a bug, please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineSubscriberOnlyError extends BaseError {\n constructor() {\n super({\n message: 'The requested video is for subscribers only',\n help: 'Subscriber videos are part of a paid service, if you wish to upgrade you can do so here: https://comicvine.gamespot.com/upgrade/',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineUnauthorizedError extends BaseError {\n constructor() {\n super({\n message: 'Unauthorized response received when calling the Comic Vine API',\n help: 'Ensure you have a valid API key, you can get one from: https://comicvine.gamespot.com/api/',\n });\n }\n}\n","import { BaseError } from './base-error.js';\n\nexport class ComicVineUrlFormatError extends BaseError {\n constructor() {\n super({\n message: 'The url for the request was not in the correct format',\n help: 'Please open a Github issue with steps to reproduce: https://github.com/AllyMurray/comic-vine/issues',\n });\n }\n}\n","export const isObject = (maybeObject: unknown) =>\n maybeObject === Object(maybeObject) &&\n !Array.isArray(maybeObject) &&\n typeof maybeObject !== 'function';\n","import { isObject } from './is-object.js';\n\nexport const toCamelCase = (str: string): string => {\n return str.replace(/([-_][a-z])/gi, ($1) => {\n return $1.toUpperCase().replace('-', '').replace('_', '');\n });\n};\n\nexport const toSnakeCase = (str: string) =>\n str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n\ntype CaseConverter = (str: string) => string;\n\nconst convertCase = (\n caseConverter: CaseConverter,\n object: unknown,\n): unknown => {\n if (isObject(object)) {\n const newObject: Record<string, unknown> = {};\n\n Object.keys(object as Record<string, unknown>).forEach((key) => {\n newObject[caseConverter(key)] = convertCase(\n caseConverter,\n (object as Record<string, unknown>)[key],\n );\n });\n\n return newObject;\n } else if (Array.isArray(object)) {\n return object.map((arrayElement) =>\n convertCase(caseConverter, arrayElement),\n );\n }\n\n return object;\n};\n\nexport const convertSnakeCaseToCamelCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toCamelCase, object) as ReturnType;\n};\n\nexport const convertCamelCaseToSnakeCase = <ReturnType>(\n object: unknown,\n): ReturnType => {\n return convertCase(toSnakeCase, object) as ReturnType;\n};\n","import type { HttpErrorContext } from '@http-client-toolkit/core';\nimport { StatusCode } from './status-code.js';\nimport {\n ComicVineFilterError,\n ComicJsonpCallbackMissingError,\n ComicVineObjectNotFoundError,\n ComicVineSubscriberOnlyError,\n ComicVineUrlFormatError,\n ComicVineUnauthorizedError,\n ComicVineGenericRequestError,\n} from '../errors/index.js';\nimport { convertSnakeCaseToCamelCase } from '../utils/case-converter.js';\n\n/**\n * Transforms snake_case API responses to camelCase.\n * Plugs into the toolkit's `responseTransformer` hook.\n */\nexport function comicVineResponseTransformer(data: unknown): unknown {\n return convertSnakeCaseToCamelCase(data);\n}\n\n/**\n * Checks Comic Vine application-level status codes and throws domain errors.\n * Plugs into the toolkit's `responseHandler` hook.\n *\n * Comic Vine returns 200 OK for application-level errors with a `statusCode`\n * field in the response body that indicates the actual result.\n */\nexport function comicVineResponseHandler(data: unknown): unknown {\n if (\n data !== null &&\n typeof data === 'object' &&\n 'statusCode' in data &&\n typeof (data as Record<string, unknown>).statusCode === 'number'\n ) {\n const statusCode = (data as Record<string, unknown>).statusCode as number;\n switch (statusCode) {\n case StatusCode.FilterError:\n throw new ComicVineFilterError();\n case StatusCode.JsonpCallbackMissing:\n throw new ComicJsonpCallbackMissingError();\n case StatusCode.ObjectNotFound:\n throw new ComicVineObjectNotFoundError();\n case StatusCode.SubscriberOnlyVideo:\n throw new ComicVineSubscriberOnlyError();\n case StatusCode.UrlFormatError:\n throw new ComicVineUrlFormatError();\n }\n }\n return data;\n}\n\n/**\n * Maps HTTP errors to Comic Vine domain-specific errors.\n * Plugs into the toolkit's `errorHandler` hook.\n */\nexport function comicVineErrorHandler(context: HttpErrorContext): Error {\n if (context.response.status === 401) {\n return new ComicVineUnauthorizedError();\n }\n\n const bodyMessage =\n typeof context.response.data === 'object' && context.response.data !== null\n ? (context.response.data as { message?: string }).message\n : undefined;\n const message = bodyMessage\n ? `${context.message}, ${bodyMessage}`\n : context.message;\n return new ComicVineGenericRequestError(message);\n}\n","export * from './character/index.js';\nexport * from './concept/index.js';\nexport * from './episode/index.js';\nexport * from './issue/index.js';\nexport * from './location/index.js';\nexport * from './movie/index.js';\nexport * from './origin/index.js';\nexport * from './person/index.js';\nexport * from './power/index.js';\nexport * from './promo/index.js';\nexport * from './publisher/index.js';\nexport * from './series/index.js';\nexport * from './story-arc/index.js';\nexport * from './team/index.js';\nexport * from './thing/index.js';\nexport * from './video/index.js';\nexport * from './video-category/index.js';\nexport * from './video-type/index.js';\nexport * from './volume/index.js';\n","import { ResourceType } from './resource-type.js';\nimport type {\n RetrieveOptions,\n ListOptions,\n HttpClient,\n UrlBuilder,\n PickFilters,\n} from '../types/index.js';\nimport type { Response } from '../types/response.js';\n\n// Common interface that all resources must implement\nexport interface ResourceInterface {\n retrieve(id: number, options?: Record<string, unknown>): Promise<unknown>;\n list(\n options?: Record<string, unknown>,\n ): Promise<unknown> & AsyncIterable<unknown>;\n}\n\nexport abstract class BaseResource<\n Resource,\n ResourceListItem,\n> implements ResourceInterface {\n protected abstract resourceType: ResourceType;\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n async retrieve<FieldKey extends keyof Resource>(\n id: number,\n options?: RetrieveOptions<FieldKey>,\n ) {\n type ReturnType<T> = T extends object ? Pick<Resource, FieldKey> : Resource;\n\n const url = this.urlBuilder.retrieve(this.resourceType, id, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<ResponseType>>(url, {\n priority: options?.priority,\n });\n\n return response.results;\n }\n\n private async fetchPage<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n type ReturnType<T> = T extends object\n ? Pick<ResourceListItem, FieldKey>\n : ResourceListItem;\n\n const url = this.urlBuilder.list(this.resourceType, options);\n const _fieldList = options?.fieldList;\n type ResponseType = ReturnType<typeof _fieldList>;\n const response = await this.httpClient.get<Response<Array<ResponseType>>>(\n url,\n {\n priority: options?.priority,\n },\n );\n\n return {\n limit: response.limit,\n numberOfPageResults: response.numberOfPageResults,\n numberOfTotalResults: response.numberOfTotalResults,\n offset: response.offset,\n data: response.results,\n };\n }\n\n list<FieldKey extends keyof ResourceListItem>(\n options?: ListOptions<FieldKey, PickFilters<ResourceListItem>>,\n ) {\n // Proxy the call to this.fetchPage so that we can close over `this`, allowing access in the iterator\n const fetchPage = (opts?: Parameters<typeof this.fetchPage>[0]) =>\n this.fetchPage.call(this, opts);\n const fetchPagePromise = fetchPage(options);\n\n const asyncIterator = {\n async *[Symbol.asyncIterator]() {\n const defaultPageSize = 100;\n const limit = options?.limit ?? defaultPageSize;\n let page = options?.offset ? options.offset / limit + 1 : 1;\n let response = await fetchPagePromise;\n\n while (true) {\n for (const resource of response.data) {\n yield resource;\n }\n\n if (\n response.limit + response.offset >=\n response.numberOfTotalResults\n ) {\n break;\n }\n\n response = await fetchPage({\n limit,\n offset: response.numberOfPageResults * page++,\n });\n }\n },\n };\n\n const promiseWithAsyncIterator = Object.assign(\n fetchPagePromise,\n asyncIterator,\n );\n\n return promiseWithAsyncIterator;\n }\n}\n","/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\nexport enum ResourceType {\n Character = 4005,\n Concept = 4015,\n Episode = 4070,\n Issue = 4000,\n Location = 4020,\n Movie = 4025,\n Origin = 4030,\n Person = 4040,\n Power = 4035,\n Promo = 1700,\n Publisher = 4010,\n Series = 4075,\n StoryArc = 4045,\n Team = 4060,\n Thing = 4055,\n Video = 2300,\n VideoCategory = 2320,\n VideoType = 2320,\n Volume = 4050,\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { CharacterDetails, CharacterListItem } from './types/index.js';\n\nexport class Character extends BaseResource<\n CharacterDetails,\n CharacterListItem\n> {\n protected resourceType: ResourceType = ResourceType.Character;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ConceptDetails, ConceptListItem } from './types/index.js';\n\nexport class Concept extends BaseResource<ConceptDetails, ConceptListItem> {\n protected resourceType: ResourceType = ResourceType.Concept;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { EpisodeDetails, EpisodeListItem } from './types/index.js';\n\nexport class Episode extends BaseResource<EpisodeDetails, EpisodeListItem> {\n protected resourceType: ResourceType = ResourceType.Episode;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { IssueDetails, IssueListItem } from './types/index.js';\n\nexport class Issue extends BaseResource<IssueDetails, IssueListItem> {\n protected resourceType: ResourceType = ResourceType.Issue;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { LocationDetails, LocationListItem } from './types/index.js';\n\nexport class Location extends BaseResource<LocationDetails, LocationListItem> {\n protected resourceType: ResourceType = ResourceType.Location;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { MovieDetails, MovieListItem } from './types/index.js';\n\nexport class Movie extends BaseResource<MovieDetails, MovieListItem> {\n protected resourceType: ResourceType = ResourceType.Movie;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { OriginDetails, OriginListItem } from './types/index.js';\n\nexport class Origin extends BaseResource<OriginDetails, OriginListItem> {\n protected resourceType: ResourceType = ResourceType.Origin;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PersonDetails, PersonListItem } from './types/index.js';\n\nexport class Person extends BaseResource<PersonDetails, PersonListItem> {\n protected resourceType: ResourceType = ResourceType.Person;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PowerDetails, PowerListItem } from './types/index.js';\n\nexport class Power extends BaseResource<PowerDetails, PowerListItem> {\n protected resourceType: ResourceType = ResourceType.Power;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PromoDetails, PromoListItem } from './types/index.js';\n\nexport class Promo extends BaseResource<PromoDetails, PromoListItem> {\n protected resourceType: ResourceType = ResourceType.Promo;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { PublisherDetails, PublisherListItem } from './types/index.js';\n\nexport class Publisher extends BaseResource<\n PublisherDetails,\n PublisherListItem\n> {\n protected resourceType: ResourceType = ResourceType.Publisher;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { SeriesDetails, SeriesListItem } from './types/index.js';\n\nexport class Series extends BaseResource<SeriesDetails, SeriesListItem> {\n protected resourceType: ResourceType = ResourceType.Series;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { StoryArcDetails, StoryArcListItem } from './types/index.js';\n\nexport class StoryArc extends BaseResource<StoryArcDetails, StoryArcListItem> {\n protected resourceType: ResourceType = ResourceType.StoryArc;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { TeamDetails, TeamListItem } from './types/index.js';\n\nexport class Team extends BaseResource<TeamDetails, TeamListItem> {\n protected resourceType: ResourceType = ResourceType.Team;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { ThingDetails, ThingListItem } from './types/index.js';\n\nexport class Thing extends BaseResource<ThingDetails, ThingListItem> {\n protected resourceType: ResourceType = ResourceType.Thing;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoDetails, VideoListItem } from './types/index.js';\n\nexport class Video extends BaseResource<VideoDetails, VideoListItem> {\n protected resourceType: ResourceType = ResourceType.Video;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoCategoryDetails, VideoCategoryListItem } from './types/index.js';\n\nexport class VideoCategory extends BaseResource<\n VideoCategoryDetails,\n VideoCategoryListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoCategory;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VideoTypeDetails, VideoTypeListItem } from './types/index.js';\n\nexport class VideoType extends BaseResource<\n VideoTypeDetails,\n VideoTypeListItem\n> {\n protected resourceType: ResourceType = ResourceType.VideoType;\n}\n","import { BaseResource } from '../base-resource.js';\nimport { ResourceType } from '../resource-type.js';\nimport { VolumeDetails, VolumeListItem } from './types/index.js';\n\nexport class Volume extends BaseResource<VolumeDetails, VolumeListItem> {\n protected resourceType: ResourceType = ResourceType.Volume;\n}\n","import * as resources from './resource-list.js';\nimport { HttpClient, UrlBuilder } from '../types/index.js';\n\nexport class ResourceFactory {\n private _resources = { ...resources };\n\n constructor(\n private httpClient: HttpClient,\n private urlBuilder: UrlBuilder,\n ) {}\n\n public create<T extends keyof typeof this._resources>(\n name: T,\n ): InstanceType<(typeof this._resources)[T]>;\n public create(\n name: keyof typeof this._resources,\n ): InstanceType<(typeof this._resources)[keyof typeof this._resources]> {\n if (!this._resources[name]) {\n throw new Error(`${name} resource not implemented`);\n }\n const ResourceClass = this._resources[name] as new (\n httpClient: HttpClient,\n urlBuilder: UrlBuilder,\n ) => InstanceType<(typeof this._resources)[keyof typeof this._resources]>;\n return new ResourceClass(this.httpClient, this.urlBuilder);\n }\n}\n","import { ResourceType } from './resource-type.js';\n\ninterface Resource {\n detailName: string;\n listName: string;\n}\n\nconst resourceMap = new Map<ResourceType, Resource>([\n [ResourceType.Character, { detailName: 'character', listName: 'characters' }],\n [ResourceType.Concept, { detailName: 'concept', listName: 'concepts' }],\n [ResourceType.Episode, { detailName: 'episode', listName: 'episodes' }],\n [ResourceType.Issue, { detailName: 'issue', listName: 'issues' }],\n [ResourceType.Location, { detailName: 'location', listName: 'locations' }],\n [ResourceType.Movie, { detailName: 'movie', listName: 'movies' }],\n [ResourceType.Origin, { detailName: 'origin', listName: 'origins' }],\n [ResourceType.Person, { detailName: 'person', listName: 'people' }],\n [ResourceType.Power, { detailName: 'power', listName: 'powers' }],\n [ResourceType.Promo, { detailName: 'promo', listName: 'promos' }],\n [ResourceType.Publisher, { detailName: 'publisher', listName: 'publishers' }],\n [ResourceType.Series, { detailName: 'series', listName: 'series_list' }],\n [ResourceType.StoryArc, { detailName: 'story_arc', listName: 'story_arcs' }],\n [ResourceType.Team, { detailName: 'team', listName: 'teams' }],\n [ResourceType.Thing, { detailName: 'object', listName: 'objects' }],\n [ResourceType.Video, { detailName: 'video', listName: 'videos' }],\n [\n ResourceType.VideoCategory,\n { detailName: 'video_category', listName: 'video_categories' },\n ],\n [\n ResourceType.VideoType,\n { detailName: 'video_type', listName: 'video_types' },\n ],\n [ResourceType.Volume, { detailName: 'volume', listName: 'volumes' }],\n]);\n\nexport const getResource = (resourceType: ResourceType) => {\n const resource = resourceMap.get(resourceType);\n if (!resource) {\n throw new Error(`Resource type (${resourceType}) not found`);\n }\n return resource;\n};\n","import { getResource, ResourceType } from '../resources/index.js';\nimport { RetrieveOptions, ListOptions, Sort } from '../types/index.js';\nimport { toSnakeCase, convertCamelCaseToSnakeCase } from '../utils/index.js';\n\nconst isDefined = <T>(value: T): value is NonNullable<T> => {\n return value != null;\n};\n\ninterface QueryParam {\n name: string;\n value: string | number;\n}\n\nexport class UrlBuilder {\n constructor(\n private apiKey: string,\n private baseUrl: string,\n ) {}\n\n private getParam(key: string, value: string | number | undefined) {\n if (value) {\n return { name: toSnakeCase(key), value };\n }\n\n return undefined;\n }\n\n private getFormatParm() {\n return { name: 'format', value: `json` };\n }\n\n private getApiKeyParm() {\n return { name: 'api_key', value: this.apiKey };\n }\n\n private getSortParam(sort?: Sort) {\n if (sort) {\n return { name: 'sort', value: `${sort.field}:${sort.direction}` };\n }\n\n return undefined;\n }\n\n private getLimitParam(limit?: number) {\n if (limit) {\n return this.getParam('limit', limit);\n }\n\n return undefined;\n }\n\n private getOffsetParam(offset?: number) {\n if (offset) {\n return this.getParam('offset', offset);\n }\n\n return undefined;\n }\n\n private getFieldListParams<Key>(fieldList: Array<Key> | undefined) {\n if (fieldList) {\n return {\n name: 'field_list',\n value: fieldList.map((field) => toSnakeCase(String(field))).join(','),\n };\n }\n\n return undefined;\n }\n\n private getFilterParams<FilterType>(filter: FilterType | undefined) {\n if (filter) {\n const snakeCaseFilter =\n convertCamelCaseToSnakeCase<Record<string, unknown>>(filter);\n const filterParams = Object.entries<unknown>(snakeCaseFilter).map(\n ([key, value]) => `${key}:${value}`,\n );\n\n return { name: 'filter', value: filterParams.join(',') };\n }\n\n return undefined;\n }\n\n private buildUrl(\n urlInput: string,\n queryParams: Array<QueryParam | undefined>,\n ) {\n const url = new URL(urlInput, this.baseUrl);\n const urlSearchParams = new URLSearchParams(\n queryParams\n .filter(isDefined)\n .map<[string, string]>((param) => [param.name, param.value.toString()]),\n );\n\n url.search = urlSearchParams.toString();\n\n return url.toString();\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @param id A unique identifier for the resource\n * @returns A url for requesting the resource\n * @example https://comicvine.gamespot.com/api/issue/4000-719442?format=json&api_key=123abc\n */\n retrieve<Key>(\n resourceType: ResourceType,\n id: number,\n options?: RetrieveOptions<Key>,\n ) {\n const resource = getResource(resourceType);\n const urlInput = `${resource.detailName}/${resourceType}-${id}`;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getFieldListParams(options?.fieldList),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n\n /**\n * @param resourceType A unique identifier for the resource type\n * @returns A url for requesting a list of resources\n * @example https://comicvine.gamespot.com/api/issues?format=json&api_key=123abc\n */\n list<Resource, FilterType>(\n resourceType: ResourceType,\n options?: ListOptions<Resource, FilterType>,\n ) {\n const urlInput = getResource(resourceType).listName;\n const queryParams = [\n this.getFormatParm(),\n this.getApiKeyParm(),\n this.getLimitParam(options?.limit),\n this.getOffsetParam(options?.offset),\n this.getSortParam(options?.sort),\n this.getFieldListParams(options?.fieldList),\n this.getFilterParams(options?.filter),\n ];\n return this.buildUrl(urlInput, queryParams);\n }\n}\n","import { z, ZodError } from 'zod';\nimport { customError, OptionsValidationError } from '../errors/index.js';\n\nconst options = z.object({\n /**\n * The base url for the Comic Vine API.\n * This could be used to set a proxy when using the library in a browser.\n * It also ensures that if the comic vine url was to change it wouldn't be a breaking change to the library.\n * @default https://comicvine.gamespot.com/api/\n */\n baseUrl: z\n .string()\n .url()\n .optional()\n .default('https://comicvine.gamespot.com/api/'),\n});\n\nexport type userOptions = z.input<typeof options>;\nexport type Options = z.output<typeof options>;\n\nexport const loadOptions = (userOptions?: userOptions) => {\n try {\n return options.parse(userOptions ?? {});\n } catch (error: unknown) {\n if (error instanceof ZodError) {\n const validationError = error.issues[0];\n if (validationError) {\n throw new OptionsValidationError(\n validationError.path.filter(\n (segment): segment is string | number =>\n typeof segment === 'string' || typeof segment === 'number',\n ),\n validationError.message,\n );\n }\n throw new OptionsValidationError([], 'Unknown validation error');\n }\n throw customError(error);\n }\n};\n","import {\n HttpClient,\n type CacheStore,\n type DedupeStore,\n type RateLimitStore,\n} from '@http-client-toolkit/core';\nimport {\n comicVineResponseTransformer,\n comicVineResponseHandler,\n comicVineErrorHandler,\n} from './http-client/hooks.js';\nimport { UrlBuilder } from './http-client/url-builder.js';\nimport { loadOptions } from './options/index.js';\nimport type { ResourceInterface } from './resources/base-resource.js';\nimport { ResourceFactory } from './resources/index.js';\nimport * as resources from './resources/resource-list.js';\nimport { getResource } from './resources/resource-map.js';\nimport { ResourceType } from './resources/resource-type.js';\nimport { toSnakeCase } from './utils/index.js';\n\nfunction classNameToPropertyName(className: string): string {\n if (!className) {\n return '';\n }\n return className.charAt(0).toLowerCase() + className.slice(1);\n}\n\ntype ResourceInstance = ReturnType<ResourceFactory['create']> &\n ResourceInterface;\n\n// Create resource property type mapping dynamically\ntype ResourcePropertyMap = {\n [K in keyof typeof resources as Uncapitalize<K>]: InstanceType<\n (typeof resources)[K]\n >;\n};\n\nconst resourceMappings = Object.values(ResourceType)\n .filter((value): value is ResourceType => typeof value === 'number')\n .map((resourceType) => getResource(resourceType));\n\nconst canonicalRateLimitResourceNames = new Map<string, string>();\nfor (const { detailName, listName } of resourceMappings) {\n canonicalRateLimitResourceNames.set(detailName, listName);\n canonicalRateLimitResourceNames.set(listName, listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(detailName), listName);\n canonicalRateLimitResourceNames.set(toSnakeCase(listName), listName);\n}\n\nfunction normalizeRateLimitResourceName(resourceName: string): string {\n return (\n canonicalRateLimitResourceNames.get(toSnakeCase(resourceName)) ??\n resourceName\n );\n}\n\nfunction inferComicVineRateLimitResource(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n const segments = pathname.split('/').filter(Boolean);\n const apiIndex = segments.indexOf('api');\n const endpoint = apiIndex >= 0 ? segments[apiIndex + 1] : segments[0];\n\n if (!endpoint) {\n return 'unknown';\n }\n\n return normalizeRateLimitResourceName(endpoint);\n } catch {\n return 'unknown';\n }\n}\n\n/**\n * Consolidated options interface for ComicVine client\n */\nexport interface ComicVineOptions {\n /** Comic Vine API key */\n apiKey: string;\n\n /** Base URL for the Comic Vine API */\n baseUrl?: string;\n\n /** Store implementations for caching, deduplication, and rate limiting */\n stores?: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n /** HTTP client configuration */\n client?: {\n /** Default cache TTL in seconds */\n defaultCacheTTL?: number;\n /** Whether to throw errors on rate limit violations */\n throwOnRateLimit?: boolean;\n /** Maximum time to wait for rate limit in milliseconds */\n maxWaitTime?: number;\n };\n}\n\nexport class ComicVine implements ResourcePropertyMap {\n private resourceFactory: ResourceFactory;\n private resourceCache = new Map<string, ResourceInstance>();\n private resourceNames: Array<string>;\n private stores: {\n cache?: CacheStore;\n dedupe?: DedupeStore;\n rateLimit?: RateLimitStore;\n };\n\n // TypeScript property declarations for static typing (will be provided by Proxy)\n declare readonly character: ResourcePropertyMap['character'];\n declare readonly concept: ResourcePropertyMap['concept'];\n declare readonly episode: ResourcePropertyMap['episode'];\n declare readonly issue: ResourcePropertyMap['issue'];\n declare readonly location: ResourcePropertyMap['location'];\n declare readonly movie: ResourcePropertyMap['movie'];\n declare readonly origin: ResourcePropertyMap['origin'];\n declare readonly person: ResourcePropertyMap['person'];\n declare readonly power: ResourcePropertyMap['power'];\n declare readonly promo: ResourcePropertyMap['promo'];\n declare readonly publisher: ResourcePropertyMap['publisher'];\n declare readonly series: ResourcePropertyMap['series'];\n declare readonly storyArc: ResourcePropertyMap['storyArc'];\n declare readonly team: ResourcePropertyMap['team'];\n declare readonly thing: ResourcePropertyMap['thing'];\n declare readonly video: ResourcePropertyMap['video'];\n declare readonly videoCategory: ResourcePropertyMap['videoCategory'];\n declare readonly videoType: ResourcePropertyMap['videoType'];\n declare readonly volume: ResourcePropertyMap['volume'];\n\n /**\n * Create a new ComicVine client\n * @param options - Configuration options for the client\n */\n constructor(options: ComicVineOptions) {\n const { apiKey, baseUrl, stores = {}, client = {} } = options;\n\n const _options = loadOptions({ baseUrl });\n\n const httpClient = new HttpClient({\n name: 'comic-vine-sdk',\n cache: stores.cache\n ? {\n store: stores.cache,\n ttl: client.defaultCacheTTL,\n }\n : undefined,\n dedupe: stores.dedupe,\n rateLimit: stores.rateLimit\n ? {\n store: stores.rateLimit,\n throw: client.throwOnRateLimit,\n maxWaitTime: client.maxWaitTime,\n }\n : undefined,\n responseTransformer: comicVineResponseTransformer,\n responseHandler: comicVineResponseHandler,\n errorHandler: comicVineErrorHandler,\n resourceKeyResolver: inferComicVineRateLimitResource,\n });\n const urlBuilder = new UrlBuilder(apiKey, _options.baseUrl);\n\n this.resourceFactory = new ResourceFactory(httpClient, urlBuilder);\n this.stores = stores;\n\n // Discover available resources dynamically\n this.resourceNames = Object.keys(resources);\n\n // Return a proxy that provides lazy loading with full type safety\n return new Proxy(this, {\n get(target, prop: string | symbol) {\n if (typeof prop === 'string' && target.isResourceProperty(prop)) {\n return target.getResource(prop);\n }\n return Reflect.get(target, prop);\n },\n }) as ComicVine;\n }\n\n private isResourceProperty(prop: string): boolean {\n // Check if this property corresponds to a known resource\n const className = prop.charAt(0).toUpperCase() + prop.slice(1);\n return this.resourceNames.includes(className);\n }\n\n private getResource(propertyName: string): ResourceInstance {\n // Lazy loading: create resource only when first accessed\n if (!this.resourceCache.has(propertyName)) {\n const className =\n propertyName.charAt(0).toUpperCase() + propertyName.slice(1);\n try {\n const resource = this.resourceFactory.create(\n className as keyof typeof resources,\n );\n\n this.resourceCache.set(propertyName, resource);\n } catch (error) {\n throw new Error(`Failed to create resource '${className}': ${error}`, {\n cause: error,\n });\n }\n }\n return this.resourceCache.get(propertyName)!;\n }\n\n getAvailableResources(): Array<string> {\n return this.resourceNames.map((name) => classNameToPropertyName(name));\n }\n\n hasResource(resourceName: string): boolean {\n return this.isResourceProperty(resourceName);\n }\n\n getResourceByName(resourceName: string): ResourceInstance | undefined {\n if (!this.isResourceProperty(resourceName)) {\n return undefined;\n }\n return this.getResource(resourceName);\n }\n\n isResourceLoaded(resourceName: string): boolean {\n return this.resourceCache.has(resourceName);\n }\n\n getCacheStats(): {\n total: number;\n loaded: number;\n loadedResources: Array<string>;\n } {\n const total = this.resourceNames.length;\n const loaded = this.resourceCache.size;\n const loadedResources = Array.from(this.resourceCache.keys());\n return { total, loaded, loadedResources };\n }\n\n async clearCache(): Promise<void> {\n if (this.stores.cache) {\n await this.stores.cache.clear();\n }\n }\n\n async getRateLimitStatus(resourceName: string) {\n if (this.stores.rateLimit) {\n return this.stores.rateLimit.getStatus(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n return null;\n }\n\n async resetRateLimit(resourceName: string): Promise<void> {\n if (this.stores.rateLimit) {\n await this.stores.rateLimit.reset(\n normalizeRateLimitResourceName(resourceName),\n );\n }\n }\n}\n","import { ComicVine } from './comic-vine.js';\nimport { StatusCode } from './http-client/status-code.js';\n\nexport default ComicVine;\n\n// Named exports for better tree-shaking\nexport { ComicVine };\n\n// Export all error types\nexport * from './errors/index.js';\n\n// Export all types\nexport * from './types/index.js';\n\n// Export Comic Vine specific HTTP utilities\nexport { StatusCode };\n\n// Re-export client options\nexport type { ComicVineOptions } from './comic-vine.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comic-vine-sdk",
|
|
3
3
|
"description": "A JS/TS client for the Comic Vine API",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/AllyMurray/comic-vine.git"
|
|
@@ -14,37 +14,38 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@http-client-toolkit/core": "4.0.0",
|
|
17
|
-
"zod": "3.
|
|
17
|
+
"zod": "4.3.6"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@changesets/cli": "^2.
|
|
21
|
-
"@
|
|
22
|
-
"@eslint/js": "^9.0.0",
|
|
20
|
+
"@changesets/cli": "^2.30.0",
|
|
21
|
+
"@eslint/js": "^10.0.1",
|
|
23
22
|
"@http-client-toolkit/store-memory": "4.0.0",
|
|
24
|
-
"@
|
|
23
|
+
"@size-limit/file": "^12.0.1",
|
|
24
|
+
"@types/node": "25.6.0",
|
|
25
25
|
"@types/pluralize": "^0.0.33",
|
|
26
|
-
"change-case": "^5.
|
|
27
|
-
"cheerio": "^1.
|
|
28
|
-
"esbuild": "^0.
|
|
29
|
-
"eslint": "^
|
|
30
|
-
"eslint-config-prettier": "^10.1.
|
|
31
|
-
"eslint-import-resolver-node": "^0.3.
|
|
26
|
+
"change-case": "^5.4.4",
|
|
27
|
+
"cheerio": "^1.2.0",
|
|
28
|
+
"esbuild": "^0.28.0",
|
|
29
|
+
"eslint": "^10.2.0",
|
|
30
|
+
"eslint-config-prettier": "^10.1.8",
|
|
31
|
+
"eslint-import-resolver-node": "^0.3.10",
|
|
32
32
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
33
33
|
"eslint-plugin-import": "^2.32.0",
|
|
34
|
-
"eslint-plugin-prettier": "^5.5.
|
|
35
|
-
"globals": "^
|
|
34
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
35
|
+
"globals": "^17.5.0",
|
|
36
36
|
"husky": "9.1.7",
|
|
37
|
-
"nock": "14.0.
|
|
37
|
+
"nock": "14.0.12",
|
|
38
38
|
"pluralize": "^8.0.0",
|
|
39
|
-
"prettier": "3.
|
|
40
|
-
"rimraf": "6.
|
|
41
|
-
"size-limit": "^
|
|
42
|
-
"tsd": "^0.
|
|
43
|
-
"tsup": "8.5.
|
|
44
|
-
"tsx": "^4.
|
|
45
|
-
"typescript": "
|
|
46
|
-
"typescript-eslint": "^8.
|
|
47
|
-
"
|
|
39
|
+
"prettier": "3.8.2",
|
|
40
|
+
"rimraf": "6.1.3",
|
|
41
|
+
"size-limit": "^12.0.1",
|
|
42
|
+
"tsd": "^0.33.0",
|
|
43
|
+
"tsup": "8.5.1",
|
|
44
|
+
"tsx": "^4.21.0",
|
|
45
|
+
"typescript": "6.0.2",
|
|
46
|
+
"typescript-eslint": "^8.58.1",
|
|
47
|
+
"vite": "7.3.2",
|
|
48
|
+
"vitest": "^4.1.4"
|
|
48
49
|
},
|
|
49
50
|
"keywords": [
|
|
50
51
|
"comic-metadata",
|