isbnlab 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -940,7 +940,8 @@ function BookFromJSONTyped(json, ignoreDiscriminator) {
940
940
  "estimatedReadTime": json["estimatedReadTime"] == null ? void 0 : json["estimatedReadTime"],
941
941
  "languagesCount": json["languagesCount"] == null ? void 0 : json["languagesCount"],
942
942
  "link": json["link"] == null ? void 0 : json["link"],
943
- "isbnModel": json["isbnModel"] == null ? void 0 : IsbnDetailsFromJSON(json["isbnModel"])
943
+ "isbnModel": json["isbnModel"] == null ? void 0 : IsbnDetailsFromJSON(json["isbnModel"]),
944
+ "otherEditionsCount": json["otherEditionsCount"] == null ? void 0 : json["otherEditionsCount"]
944
945
  };
945
946
  }
946
947
  function BookToJSON(json) {
@@ -990,6 +991,39 @@ function BookToJSONTyped(value, ignoreDiscriminator = false) {
990
991
  };
991
992
  }
992
993
 
994
+ // src/models/CoverSize.ts
995
+ function instanceOfCoverSize(value) {
996
+ return true;
997
+ }
998
+ function CoverSizeFromJSON(json) {
999
+ return CoverSizeFromJSONTyped(json, false);
1000
+ }
1001
+ function CoverSizeFromJSONTyped(json, ignoreDiscriminator) {
1002
+ if (json == null) {
1003
+ return json;
1004
+ }
1005
+ return {
1006
+ "url": json["url"] == null ? void 0 : json["url"],
1007
+ "w200": json["w200"] == null ? void 0 : json["w200"],
1008
+ "w400": json["w400"] == null ? void 0 : json["w400"],
1009
+ "w800": json["w800"] == null ? void 0 : json["w800"]
1010
+ };
1011
+ }
1012
+ function CoverSizeToJSON(json) {
1013
+ return CoverSizeToJSONTyped(json, false);
1014
+ }
1015
+ function CoverSizeToJSONTyped(value, ignoreDiscriminator = false) {
1016
+ if (value == null) {
1017
+ return value;
1018
+ }
1019
+ return {
1020
+ "url": value["url"],
1021
+ "w200": value["w200"],
1022
+ "w400": value["w400"],
1023
+ "w800": value["w800"]
1024
+ };
1025
+ }
1026
+
993
1027
  // src/models/BookCover.ts
994
1028
  function instanceOfBookCover(value) {
995
1029
  return true;
@@ -1003,7 +1037,8 @@ function BookCoverFromJSONTyped(json, ignoreDiscriminator) {
1003
1037
  }
1004
1038
  return {
1005
1039
  "isbn13": json["isbn13"] == null ? void 0 : json["isbn13"],
1006
- "covers": json["covers"] == null ? void 0 : json["covers"]
1040
+ "covers": json["covers"] == null ? void 0 : json["covers"],
1041
+ "sizes": json["sizes"] == null ? void 0 : json["sizes"].map(CoverSizeFromJSON)
1007
1042
  };
1008
1043
  }
1009
1044
  function BookCoverToJSON(json) {
@@ -1015,7 +1050,8 @@ function BookCoverToJSONTyped(value, ignoreDiscriminator = false) {
1015
1050
  }
1016
1051
  return {
1017
1052
  "isbn13": value["isbn13"],
1018
- "covers": value["covers"]
1053
+ "covers": value["covers"],
1054
+ "sizes": value["sizes"] == null ? void 0 : value["sizes"].map(CoverSizeToJSON)
1019
1055
  };
1020
1056
  }
1021
1057
 
@@ -2126,6 +2162,32 @@ var SubjectsApi = class extends BaseAPI {
2126
2162
  return await response.value();
2127
2163
  }
2128
2164
  };
2165
+
2166
+ // src/plan.ts
2167
+ var PLAN_RESTRICTED_FIELDS_HEADER = "X-Plan-Restricted-Fields";
2168
+ var PLAN_UPGRADE_HEADER = "X-Plan-Upgrade";
2169
+ function header(source, name) {
2170
+ let headers;
2171
+ if ("raw" in source) {
2172
+ headers = source.raw.headers;
2173
+ } else if ("headers" in source) {
2174
+ headers = source.headers;
2175
+ } else {
2176
+ headers = source;
2177
+ }
2178
+ const value = headers.get(name)?.trim();
2179
+ return value ? value : null;
2180
+ }
2181
+ function restrictedFields(source) {
2182
+ const value = header(source, PLAN_RESTRICTED_FIELDS_HEADER);
2183
+ if (value === null) {
2184
+ return [];
2185
+ }
2186
+ return value.split(",").map((field) => field.trim()).filter((field) => field !== "");
2187
+ }
2188
+ function upgradeUrl(source) {
2189
+ return header(source, PLAN_UPGRADE_HEADER);
2190
+ }
2129
2191
  export {
2130
2192
  AuthorFromJSON,
2131
2193
  AuthorFromJSONTyped,
@@ -2164,6 +2226,10 @@ export {
2164
2226
  ContributorRoleEnum,
2165
2227
  ContributorToJSON,
2166
2228
  ContributorToJSONTyped,
2229
+ CoverSizeFromJSON,
2230
+ CoverSizeFromJSONTyped,
2231
+ CoverSizeToJSON,
2232
+ CoverSizeToJSONTyped,
2167
2233
  DefaultConfig,
2168
2234
  EditionRefFromJSON,
2169
2235
  EditionRefFromJSONTyped,
@@ -2190,6 +2256,8 @@ export {
2190
2256
  OtherSeriesKindEnum,
2191
2257
  OtherSeriesToJSON,
2192
2258
  OtherSeriesToJSONTyped,
2259
+ PLAN_RESTRICTED_FIELDS_HEADER,
2260
+ PLAN_UPGRADE_HEADER,
2193
2261
  PublisherFromJSON,
2194
2262
  PublisherFromJSONTyped,
2195
2263
  PublisherToJSON,
@@ -2246,6 +2314,7 @@ export {
2246
2314
  instanceOfBookEditions,
2247
2315
  instanceOfCategory,
2248
2316
  instanceOfContributor,
2317
+ instanceOfCoverSize,
2249
2318
  instanceOfEditionRef,
2250
2319
  instanceOfEntityRef,
2251
2320
  instanceOfGenre,
@@ -2262,6 +2331,8 @@ export {
2262
2331
  instanceOfSubject,
2263
2332
  instanceOfSubjectRef,
2264
2333
  mapValues,
2265
- querystring
2334
+ querystring,
2335
+ restrictedFields,
2336
+ upgradeUrl
2266
2337
  };
2267
2338
  //# sourceMappingURL=index.mjs.map