@medialane/sdk 0.188.0 → 0.190.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.
@@ -285,7 +285,6 @@ interface IpNftMetadata {
285
285
  interface ApiTokenMetadata {
286
286
  name: string | null;
287
287
  description: string | null;
288
- content?: string | null;
289
288
  image: string | null;
290
289
  animationUrl: string | null;
291
290
  attributes: IpAttribute[] | null;
@@ -285,7 +285,6 @@ interface IpNftMetadata {
285
285
  interface ApiTokenMetadata {
286
286
  name: string | null;
287
287
  description: string | null;
288
- content?: string | null;
289
288
  image: string | null;
290
289
  animationUrl: string | null;
291
290
  attributes: IpAttribute[] | null;
package/dist/index.cjs CHANGED
@@ -453,6 +453,15 @@ async function readBodyWithCap(res, maxBytes) {
453
453
  function createImageProxyHandler(config) {
454
454
  const doFetch = config.fetchImpl ?? fetch;
455
455
  const userAgent = config.userAgent ?? DEFAULT_USER_AGENT;
456
+ const backendOrigin = config.backend ? new URL(config.backend.backendUrl).origin : null;
457
+ function headersFor(url) {
458
+ const headers2 = { "User-Agent": userAgent };
459
+ if (!config.backend || url.origin !== backendOrigin) return headers2;
460
+ if (config.backend.apiKey) headers2["x-api-key"] = config.backend.apiKey;
461
+ headers2["x-app-id"] = config.backend.appId;
462
+ if (config.backend.appSecret) headers2["x-app-secret"] = config.backend.appSecret;
463
+ return headers2;
464
+ }
456
465
  async function resolvesToPrivateHost(hostname) {
457
466
  try {
458
467
  const addresses = await config.resolveHostname(hostname);
@@ -469,7 +478,7 @@ function createImageProxyHandler(config) {
469
478
  }
470
479
  const res = await doFetch(url.toString(), {
471
480
  redirect: "manual",
472
- headers: { "User-Agent": userAgent }
481
+ headers: headersFor(url)
473
482
  });
474
483
  if (res.status >= 300 && res.status < 400) {
475
484
  const location = res.headers.get("location");
@@ -621,7 +630,8 @@ var PUBLIC_ROUTES = {
621
630
  `sponsorship/proposals/${SEG}`,
622
631
  "sponsorship/licenses",
623
632
  `sponsorship/licenses/${SEG}`,
624
- "auth/email/exists"
633
+ "auth/email/exists",
634
+ `media/${SEG}/${SEG}/${SEG}/image`
625
635
  ].map((p) => new RegExp(`^${p}$`)),
626
636
  POST: [
627
637
  "auth/email/(request-code|verify-code|register-account|confirm)",
@@ -743,7 +753,6 @@ function buildAssetMetadata(input) {
743
753
  const traitType = t.traitType?.trim() ?? "";
744
754
  const traitValue = String(t.value ?? "").trim();
745
755
  if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;
746
- if (traitType.length > 64 || traitValue.length > 512) continue;
747
756
  attributes.push({ trait_type: traitType, value: traitValue });
748
757
  }
749
758
  if (input.licenseType) {